Mikyas TADESSE Mikyas TADESSE - 10 days ago 6
AngularJS Question

Error: $injector:modulerr Module Error when i add the cookie dependency

I get the following error

Error: $injector:modulerr
Module Error


Its when i add the cookie dependency that i have the issue.
Here is how i declare my angular app :

var myApp = angular.module('myApp', ['ngResource', 'ngRoute', 'ngCookies']);


Its when i add the cookie dependency that i have the issue.
And my html file :

<!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>


Can you help

Answer

Your url for cookies script is not correct.

https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-cookie.js

should be

https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-cookies.js

Missing 's'.

I am sure, browser's console should show 404 for the request.