title: Using angular-local-storage Inside a Service?
body: <p>I am trying to use the angular-local-storage module (<a href="https://github.com/grevory/angular-local-storage" rel="nofollow">https://github.com/grevory/angular-local-storage</a>), version 0.2.2 (according to bower) in a service within my application. I seem to be having issues with it when I call it within a service, but it works fine when I put it inside a controller.</p>
  
  <p>I have it configured like this:</p>
  
  <pre><code>angular.module('myApp', [ 'LocalStorageModule' ])
      .config(function (localStorageServiceProvider) {
          localStorageServiceProvider
            .setPrefix('test')
            .setStorageType('localStorage');
       })...
  </code></pre>
  
  <p>And then in my service, I have it like this (simplified, for testing purposes):</p>
  
  <pre><code>angular.module('myApp')
      .service('UserService', [ 'localStorageService',
          function(localStorageService) {
              return {
                  save: function() {
                      localStorageService.set('user', 'me');
                  }
              };
      }]);
  </code></pre>
  
  <p>This code yields an error of: </p>
  
  <blockquote>
    <p>TypeError: localStorageService.set is not a function</p>
  </blockquote>
  
  <p>On the other hand, if I place the exact same code into a controller (indeed, the controller who calls this service), everything works as expected. Does angular-local-storage not work within services?</p>
  
  <p>Thanks in advance!</p>