Jacob Jacob - 3 months ago 25
Javascript Question

module loading failing with ngRoute

Just started learning angularJs and came across a 'Routing' assignment for practice. Unfortunately i get these error when running the application:

Error 1: Error: $injector:modulerr Module Error

Error 2: Error: $injector:nomad Module Unavailable

This is my code:

Routing.html

And

RoutingController.js

I have tried reading other relevant post on SO but without luck.
I've been stuck here for too long so any help is deeply appreciated.

//Jacob

Answer

According to your image, you have not defined the module properly, There should be a , after the module name to separate from the dependencies,

Your Module should be like this,

var app = angular.module(mainApp,['ngRoute'])