0
我使用我的AngularJS教程。为什么我在angularjs项目教程中遇到错误?
我得到这个错误:
Error: [$injector:modulerr] Failed to instantiate module sensorManagement due to:
[$injector:unpr] Unknown provider: $routeProvider
http://errors.angularjs.org/1.4.2/$injector/unpr?p0=%24routeProvider
minErr/<@http://localhost:7486/Scripts/angular.js:68:12
createInjector/providerCache.$injector<@http://localhost:7486/Scripts/angular.js:4264:19
[email protected]://localhost:7486/Scripts/angular.js:4411:39
[email protected]://localhost:7486/Scripts/angular.js:4443:1
[email protected]://localhost:7486/Scripts/angular.js:4358:11
loadModules/<@http://localhost:7486/Scripts/angular.js:4367:11
[email protected]://localhost:7486/Scripts/angular.js:336:11
[email protected]://localhost:7486/Scripts/angular.js:4348:5
[email protected]://localhost:7486/Scripts/angular.js:4274:11
bootstrap/[email protected]://localhost:7486/Scripts/angular.js:1630:20
[email protected]://localhost:7486/Scripts/angular.js:1651:1
[email protected]://localhost:7486/Scripts/angular.js:1545:5
@http://localhost:7486/Scripts/angular.js:28361:5
[email protected]://localhost:7486/Scripts/angular.js:2998:7
createEventHandler/[email protected]://localhost:7486/Scripts/angular.js:3273:9
这里是我的模块定义:
(function() {
"use strict";
var myApp = angular.module("sensorManagement", ["ngResource"])
.config(function ($routeProvider, $locationProvider) {
$routeProvider.when('/Registration/Courses', { templateUrl: '/templates/courses.html', controller: 'CoursesController' });
$routeProvider.when('/Registration/Instructors', { templateUrl: '/templates/instructors.html', controller: 'InstructorsController' });
$locationProvider.html5Mode(true);
});
}());
任何想法可能会导致上述错误?