let JSONDatas = [
{"id": "Open"},
{"id": "OpenNew", "label": "Open New"},
{"id": "ZoomIn", "label": "Zoom In"},
{"id": "ZoomOut", "label": "Zoom Out"},
{"id": "Find", "label": "Find..."},
{"id": "FindAgain", "label": "Find Again"},
{"id": "Copy"},
{"id": "CopyAgain", "label": "Copy Again"},
{"id": "CopySVG", "label": "Copy SVG"},
{"id": "ViewSVG", "label": "View SVG"}
]
localStorage.setItem("datas", JSON.stringify(JSONDatas));
let data = JSON.parse(localStorage.getItem("datas"));
console.log(data);
// 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);
});