Closed end-user closed 8 years ago
In the controller you should be injecting $localStorage or $sessionStorage - not ngStorage.
ngStorage should be added as dependency of your Angular app.
The following example should be working fine:
angular.module('app') .controller('ExpertViewController', ['Parent', 'Child', 'LookupService', '$sessionStorage', function($scope, Parent, Child, LookupService, $sessionStorage) {
Example provided by @valeksiev should be working fine. Thanks!
I'm getting a Error: [$injector:unpr] Unknown provider: ngStorageProvider <- ngStorage
I've installed this with
bower install ngstorage
, and it appears in my list of bower dependencies.I've injected it as I have with other modules:
angular.module('app') .controller('ExpertViewController', ['Parent', 'Child', 'LookupService', 'ngStorage', function($scope, Parent, Child, LookupService, $sessionStorage) {
However, when I try use it in the body of the controller function, I'm getting
Error: [$injector:unpr] Unknown provider: ngStorageProvider <- ngStorage <- ExpertViewController
This seems like the right way to go, but I can't see why it's not working.