Answers for "localstorage getitem angular"

0

angular localstorage getitem

var values = JSON.parse(localStorage.getItem("store_owner_ad_contacts"));
Posted by: Guest on June-04-2021
0

localstorage getitem angular

// Parse any JSON previously stored in allEntries
  var existingEntries = JSON.parse(localStorage.getItem("store_owner_ad_contacts"));
  if(existingEntries == null) existingEntries = [];

  var adId = {
    "id":$scope.adId
  };
  // Save allEntries back to local storage
  existingEntries.push(adId);
  localStorage.setItem("store_owner_ad_contacts", JSON.stringify(existingEntries));

  var values = JSON.parse(localStorage.getItem("store_owner_ad_contacts"));
  angular.forEach(values, function(value, key) {

  // ^ This is coming as an object how can I get the key value?

   if(value == adId){
   //form has been submitted before
   }else{
   // showformVar = true 

    console.log(key + ': ' + value);
  });
Posted by: Guest on September-21-2021

Code answers related to "localstorage getitem angular"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language