我收到以下错误
Error: $injector:modulerr
Module Error
当我添加cookie依赖时,我有问题。 以下是我如何声明我的角度应用程序:
var myApp = angular.module('myApp', ['ngResource', 'ngRoute', 'ngCookies']);
当我添加cookie依赖时,我有问题。 我的html文件:
<!doctype html>
<html ng-app="myApp">
<head>
<meta charset="utf-8">
<title>MEAN Auth</title>
<!-- styles -->
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.6/yeti/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div ng-view></div>
</div>
<!-- scripts -->
<script src="//code.jquery.com/jquery-2.2.1.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-resource.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-cookie.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular-route.min.js"></script>
<script src="./main.js"></script>
<script src="./services.js"></script>
<script src="./controllers.js"></script>
<script src="./chirpApp.js"></script>
</body>
</html>
你能帮忙吗
答案 0 :(得分:1)
您的Cookie网址脚本不正确。
https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-cookie.js
应该是
https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-cookies.js
缺少&#39;。
我确信,浏览器的控制台应该显示404请求。
答案 1 :(得分:0)
你最后错过了,
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-cookies.js"></script>
<强> DEMO 强>