I can succesfully access cookies on my controller like this.
angular.module('mobbr', [ 'ngCookies' ]).
function RegisterCtrl($scope, $cookies) { }
But whenever i try to use cookies in a service like this.
angular.module('mobbr.services', []);
angular.module('mobbr.services').factory('currentUser', [ 'ngCookies', function ($cookies) {}]);
I get the following error: ngCookiesProvider <- ngCookies <- currentUser.
Any thoughts on why this won’t work and how i should initialize a service with acces to cookies?
This is what my code for something similar looks like: