THE SITUATION:
I need to use cookies in my Angular App. I have followed what should be the proper steps to properly setup the ngCookies module in my app, but somehow it isn't working.
This is the error message i am getting:
Unknown provider: $$cookieReaderProvider <- $$cookieReader <- $cookies <- $cookies
THE STEPS:
These are the steps i have done:
- bower install angular-cookies
Choose first option in bower:
angular#1.3.13 which resolved to 1.3.13 and is required by angular-animate#1.3.13, angular-sanitize#1.3.13, ionic#1.0.0
In index.html include:
<script src="lib/angular-cookies/angular-cookies.min.js"></script>
Include the module ngCookies:
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'ngCookies']) angular.module('starter.controllers', ['ngCookies'])
Inject the service in the controller:
.controller('MainCtrl', function( $scope, $rootScope, $cookies )
VERSIONS -- EDIT
I thought the issue could be related with versions since these were the previous versions:
Angular version: 1.3.13
Angular-cookies version: 1.4.1
I have then reinstall angular to the latest version: #1.4.1 and reinstall angular-cookies but the issue persists with the same error message.
THE QUESTION:
How can i properly setup angular-cookies? Why i am getting that error?