angularjs - how to push all values from the txt file to local storage using angular js -


i have sample application can store values local storage when user clicks local button want values txt file in local storage "note2": [] .

plunker demo

to put data in localstorage in angularjs can use library angular-localforage.

example:

angular.module('yourmodule', ['localforagemodule']) .controller('yourctrl', ['$scope', '$localforage',     function($scope,$localforage) {       $localforage.setitem('myname','olivier combe').then(function() {         $localforage.getitem('myname').then(function(data) {           var myname = data;         });       });  }]); 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -