Watching local storage using angularjs -


i using module called ngstorage handling local storage operations.(https://github.com/gsklee/ngstorage). lets set object in local storage $localstorage.something = true; how watch object find out if still available in local storage? i'v tried :

$scope.$watch($localstorage.something,function(newval,oldval){    if(oldval!==newval && newval === undefined){      console.log('it undefined');    } }); 

basically trying watch when user removes object local storage manually through chrome's console.is possible??

you can try:

$scope.$watch(function () { return $localstorage.something; },function(newval,oldval){    if(oldval!==newval && newval === undefined){      console.log('it undefined');    } }) 

Comments

Popular posts from this blog

c - CUDA code not processing if block properly -

oracle11g - get root domain from url Oracle sql regex_substr -

xcode - Swift Playground - Files are not readable -