This my code:
angular.module('MyModule').controller('MyController', ['$scope', '$stateParams','$location', '$http','LocalStorageModule',
function($scope, $stateParams, $location, $http, localStorageService) {
localStorageService.add('test', 'val');
]);
any Idea whats wrong?
I'm getting exception - unknown provider localstorageservice in the FF browser
Firebug Error
Error: [$injector:unpr] Unknown provider: LocalStorageModuleProvider <- LocalStorageModule
http://errors.angularjs.org/1.2.20/$injector/unpr?p0=LocalStorageModuleProvider%20%3C- %20LocalStorageModule
at http://127.1.0.0/lib/angular/angular.js:78:12
We should ask inejctor for
'localStorageService'
instead of your'LocalStorageModule'
So the code should look like this:
And when we do initialize the module, we have to include the local storage module
And also as documented here:
we should use
.set()