javascript - Keeping created data in AngularJS -


i've general question saving data in angularjs. there opportunities save data in json files , kept them when changed site? mean when change site "persons" "home" , go "persons" created data remain in list of persons? how can resolve this? or possible webapi written in java/c# example? know this?

my example @ current push data in list of json data:

$scope.additem = function (item) {   $scope.list.push(item);   $scope.item = null; }; 

it depends on how long you're looking keep data around, there few options. if want share data between app, while user on website, of angular "services" (factory, service, provider) work singletons. more information on differences, check out answer: angularjs: service vs provider vs factory

if looking persist data across user visits, should consider using localstorage. there great angular local storage module here: https://github.com/grevory/angular-local-storage


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -