在我的角度应用程序中,我想使用 $location.path('/'); 进行重定向 但我收到此错误未捕获错误:[$injector:modulerr] 无法实例化模块 myApp 由于:错误:[$injector:modulerr] 无法实例化模块 myApp.login 由于:TypeError:无法读取属性 'html5Mode'这里的未定义是我的代码
angular.module('myApp.login', ['ngRoute', 'angular-md5'])
.config(['$routeProvider', function($routeProvider, $locationProvider) {
$routeProvider.when('/login', {
templateUrl: 'login/login.html',
controller: 'loginCtrl'
});
$locationProvider.html5Mode({
enabled: true,
requireBase: false
}).hashPrefix('!');
}])