ng路由injectore:modulerr中出错[$injector:modulerr]http://errors.a
Error in ng-route injectore:modulerr [$injector:modulerr] http://errors.angularjs.org/1.3.14/$injector/modulerr
我正试图创建一个具有角度路由的SPA(单页应用程序),但当我将ndRoute添加到我的模块时,它会给我这个错误
未捕获错误:[$injector:modulerr]http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=牙科&p1=错误%3A…tp%3A%2F%2F2127.0.0.1%3A51792%2FDemoDental%2Fjs%2Angular.min.js%3A17%3A381)
这是我的js代码
(function(){
var app= angular.module("Dental", ['ngRoute']);
app.config([$routeProvider,function($routeProvider) {
$routeProvider.when('/aggrement', {
templateUrl : 'templates/aggrement.html'
}).otherwise({
redirectTo : '/home'
});
}]);
})();
这是我的HTML代码
<!DOCTYPE html>
<html ng-app="Dental">
<head>
<title>DemoDental</title>
<meta name="viewport"
content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,width=device-width,user-scalable=no" />
<link rel="stylesheet" href="styles/styles.css">
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/angular.min.js"></script>
</head>
<body>
<div>
</div>
<!-- angular templating -->
<!-- this is where content will be injected -->
<div ng-view id="changeDiv"></div>
</div>
<script src="js/main.js"></script>
</body>
</html>
我不知道这个错误的原因,因为我觉得一切都很好,如果我从angular.module()
中删除ngRoute,程序运行良好。
提前感谢
添加角度路线
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular-route.js"></script>
相关文章:
- Meteor如何接收HTTP请求
- 在我的情况下,如何进行http请求
- //而不是在src=“”上使用http://"属性
- 我无法使用angularJs($http)访问服务器
- AJAX简单错误.XMLHttpRequest无法加载http://localhost/mpl/getPage.php.
- 如何将PHP get查询转换为Meteor's HTTP.get()
- 角度异步http自动完成
- 什么's本地node.js服务器和python简单http服务器之间的区别
- 角度http服务器页面刷新404s
- http.listen()在运行时接受终端命令
- IIS动态HTTP响应标头
- 错误:$injector:modulerr模块错误(我的第一个SPA应用程序)
- spring和angularJS(我得到了类似HTTP状态404的错误)
- 存储$http如何从$http函数(Angularjs)外部获取可访问变量中的响应
- Typescript angularjs$http获取响应类型(避免使用<any>)
- ng路由injectore:modulerr中出错[$injector:modulerr]http://errors.a
- 未捕获的错误: [$injector:modulerr] http ..(使用纯 HTML)
- Angularjs Error: [$injector:modulerr] http://errors.angularj
- Error: [$injector:modulerr] http://errors.angularjs.org
- AngularJS $http.get php file - $injector:modulerr