当使用angular 1.2代替1.07时,以下代码不再有效,为什么?
'use strict';
var app = angular.module('myapp', []);
app.config(['$routeProvider', '$locationProvider',
function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider.
when('/', {
templateUrl: 'part.html',
controller: 'MyCtrl'
}).
otherwise({
redirectTo: '/'
});
}
]);
问题出在喷射器配置部分(app.config)中:
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.0rc1/$injector/modulerr?p0=muninn&p1=Error%…eapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.0rc1%2Fangular.min.js%3A31%3A252)
如果我没记错的话,这个问题是从1.1.6开始的。
"Error: [$injector:nomod] Module 'ngRoute' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument."