Questions tagged [ng-storage]

localStorage and sessionStorage done right for AngularJS

ngStorage is a third-party angular.js module that provide common wrappers for the SessionStorage and LocalStorage browser objects specified with HTML5 APIs. This is a toolbox exposed via some angular services, like $sessionStorage and $localStorage. This module ensure offers coding facilities as a javascript library does, and ensure a good integration in your angular module architecture because you use it as dependencies for your own modules. For example, they can be mocked for unit and e2e testing.

It is an open-source (MIT) software available on github.com: https://github.com/gsklee/ngStorage

96 questions
11
votes
4 answers

Difference between ngStorage and $window.localStorage

What is the difference between ngStorage and $window.localStorage? When is it better to use one instead that the other? I have to choose one of them for a web app. I have to save data of profile user and the token
5
votes
1 answer

Protractor testing with ngStorage

I'm using ngStorage to deal with local storage and Protractor to e2e specs in an AngularJS app. describe('Test', function() { beforeEach(function () { browser.driver.manage().window().setSize(1280, 1024) …
4
votes
1 answer

How to use ngStorage in angularjs

visit https://github.com/gsklee/ngStorage. My code has 2 partials, in partial1 I've 3 input box and data entered in them be 'abc', 'pqr', 'xyz' and on click of button I want to get redirected to partial2 where input box gets populated with following…
surbhi bakshi
  • 160
  • 1
  • 1
  • 17
3
votes
1 answer

Ionic Framework and Firebase persistent Auth

I was wondering if anyone has used ionic and firebase and allowed persistent authentication. When I create an IPA/APK and download the app to my device, every time I close the app I have to log in again. Upon login with $authWithPassword the call…
Rahul Verma
  • 191
  • 2
  • 11
3
votes
1 answer

How to persist data and model in angular JS

I have one search page where user enters search criteria and search results will be displayed and when the user navigates to another page and comes back to this page the results should be persist. Each submodule has it's own app.js and controller…
3
votes
1 answer

using ngStorage as array in ionic

trying to convert this .service('dataStore', function($localStorage,$scope){ this.entfeeds=[]; this.topfeeds=[]; this.intfeeds=[]; }) .controller('GenFeedCtrl', function ($scope,.... $scope.feeds = FeedList.get(feedSources,…
3
votes
1 answer

ngStorage - Reset to default values

I'm using ngStorage for web storage. And this is the code I'm currently using to check whether the $localStorage is defined or not. if ( angular.isDefined($localStorage.settings) ) { $scope.app.settings = $localStorage.settings; } else { …
Unknown User
  • 3,598
  • 9
  • 43
  • 81
3
votes
2 answers

Does ngStorage perform operations asynchronously?

I'm working with angular.js and ngstore. I'm using a token based authentication with a node.js REST service, from the angular app I send my credentials to rest server and I receive the token, I then store this token in $localStorage to use…
Jorge
  • 33
  • 1
  • 4
2
votes
0 answers

Best Mechanism(Way) to Cache in angular4 service call data for every 20 minutes? if service is not available?

I have a angular service call to webapi , if webapi is got down , have to load the data from cache and the cache is expire after 20 minutes. Which is better way to store the data?cache and webstorage is same or different technique? if same,…
Mohamed Sahir
  • 2,482
  • 8
  • 40
  • 71
2
votes
1 answer

ngStorage module not found only in gulp dist:serve?

I strike this error one again, last time I have fixed but do not know how this fixed but again it occurs. I have ngstorage module installed and projecr run fine when it's in development ( gulp clean serve ) BUT when it goes to production ( gulp…
xkeshav
  • 53,360
  • 44
  • 177
  • 245
2
votes
3 answers

Accessing item from LocalStorage (Angular 1.2)

I am running an old version of Angular - I have an object within my localStorage and I am trying to retrieve a single item from the object (rather than the whole the thing..) var email = localStorage.user; However the output of the…
Zabs
  • 13,852
  • 45
  • 173
  • 297
2
votes
1 answer

Save key=>value style with ngStorage/localstorage

In my Ionic app I've added the plugin 'ngStorage' and it comes with a little demo code: var add = function (thing) { $localStorage.things.push(thing); } This works exactly as told. I add("foo") it, and do getAll() and the value is there. I…
Martijn
  • 15,791
  • 4
  • 36
  • 68
2
votes
1 answer

md select after local storage load required attribute not working

I am working on an angular web page on which I have used angular material controls. I have a md select control which I have defined as follows:
luisgepeto
  • 763
  • 1
  • 11
  • 36
2
votes
4 answers

Angular database without a server

I am working on an assignment for a dummy phonebook app, which is an "extra points" part of a test for a local frontend job opening. I did some basic apps with angular before, but I always used it along with php and mysql. For this project the…
2
votes
0 answers

What does angular $watch do when no return value from the function it monitor

All: I am pretty new to Angular, when I tried to understand how ngStorage works, there is some code in its source like: $rootScope.$watch(function() { _debounce || (_debounce = $timeout($storage.$apply, 100, false)); }); From Angular Scope…
Kuan
  • 11,149
  • 23
  • 93
  • 201
1
2 3 4 5 6 7