localstorage getitem angular

Solutions on MaxInterview for localstorage getitem angular by the best coders in the world

showing results for - "localstorage getitem angular"
Matías
23 Oct 2017
1var values = JSON.parse(localStorage.getItem("store_owner_ad_contacts"));
Sofia
12 Nov 2016
1    // Parse any JSON previously stored in allEntries
2  var existingEntries = JSON.parse(localStorage.getItem("store_owner_ad_contacts"));
3  if(existingEntries == null) existingEntries = [];
4
5  var adId = {
6    "id":$scope.adId
7  };
8  // Save allEntries back to local storage
9  existingEntries.push(adId);
10  localStorage.setItem("store_owner_ad_contacts", JSON.stringify(existingEntries));
11
12  var values = JSON.parse(localStorage.getItem("store_owner_ad_contacts"));
13  angular.forEach(values, function(value, key) {
14
15  // ^ This is coming as an object how can I get the key value?
16
17   if(value == adId){
18   //form has been submitted before
19   }else{
20   // showformVar = true 
21
22    console.log(key + ': ' + value);
23  });
24