Problems using ngCookies on my project


#1

I am trying to include ngCookies in a project. The angular cookies library is included in my index.html after the ionic.bundle.
I can see on the network tab of the developer tools that it is actually loading. Angular doesn’t show any error when loading the page, as it usually does when a module is missing. The problem is that, when in my code I try to access the functions of the $cookies service, the $cookies variable is actually pointing to an empty object.
Here are some relevant code snippets:
On the definition of my app.js

angular.module('myApp', [
'ionic',
'ngCookies',
'ngMessages',
'rt.eventemitter',
'myApp.views']);

On my factory:

 angular.module('myApp.views')
   .factory('UserStore', ['$rootScope', '$q', '$cookies', '$timeout', 
        function($rootScope, $q, $cookies, $timeout){
           var user = {};
          function setSessionId(sessionId){
                console.log(">> setting sessionId to:",sessionId);
                user.sessionId = sessionId;
                $cookies.put('sessionId', user.sessionId);
          }
          return{ setSessionId:setSessionId}
}]);}

In this case, when I try to call the setSessionId method I get an error that $cookies.put is not a function since, as I mentioned above, $cookies is just an empty object.

Any Ideas?