本文翻译自:AngularJS 1.2 $injector:modulerr
When using angular 1.2 instead of 1.07 the following piece of code is not valid anymore, why? 当使用角度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: '/'
});
}
]);
the issue is in the injector configuration part (app.config): 问题出在注入器配置部分(app.config):
Uncaught Error: [$injector:modulerr] http://errors.ang