当我尝试刷新页面时出现此错误:
angular.js:38 http://errors.angularjs.org/1.4.5/$injector/modulerr ?
p0=myApp&p1=错误%3A%2…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.4.5%2Fangular.min.js%3A19%3A381)
我有一个依赖 ngRoute 的简单模块:
var app = angular.module('myapp', ["ngRoute"]);
app.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl :'pages/main.html',
controller : 'mainController'
})
.when('/second',{
templateUrl : 'pages/second.html',
controller : 'secondController'
})
});
和我的html代码:
<html ng-app='myApp'>
<head><title>The title</title></head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5
/angular.min.js"></script>
<script src="https://code.angularjs.org/1.4.5/angular-route.js">
<script src="app.js"></script>
</script>
<body>
<div ng-view>
</div>
</body>
</html>