Reputation: 12228
I'm learning angular.js and have all libraries linked from CDNs.
When I try to use $locationProvider
and $routeProvider
I get this error:
Referee.config(["$locationProvider", "$routeProvider"],
function config($locationProvider, $routeProvider) {
// ...
}
);
angular.js:38Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.7/$injector/modulerr?p0=referee&p1=Error%3A…oogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js%3A7%3A355)
From what I've seen an that error page I need to include ngRoute
. So I linked route.min.js
after my angular.min.js
but it doesn't work and I still get the same error. What do I do wrong?
Upvotes: 1
Views: 61
Reputation: 2681
Everything is fine, you just missed a closing tag. You need to take care of all closing tags. so that angular js works awesome
Referee.config(["$locationProvider", "$routeProvider",
function config($locationProvider, $routeProvider) {
// ...
}
]);
Upvotes: 0
Reputation: 6440
Seems like the array syntax is wrong; close the square bracket towards the end:
Referee.config(["$locationProvider", "$routeProvider",
function config($locationProvider, $routeProvider) {
// ...
}
]);
Why array notation? - Reason for using array notation when defining AngularJS Controller
Upvotes: 3