I can successfully use cookies on my controller like this.
angular.module('mobbr', [ 'ngCookies' ]).
function RegisterCtrl($scope, $cookies) { }
But whenever I try to use cookies in such a service.
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 should I initialize the cookie access service?
source
share