I am just trying to hide something when a localStorage key is set to null, and show it when the key is not null. The key is called articles
and the way I am trying to check is:
$scope.isEmpty = function isEmpty() {
return localStorage.getItem('articles') !== null;
};
then in my html:
<li ng-show="isEmpty()"> There is actually something to see here </li>
the local storage key (from chrome dev tools) looks like this:
**key** **Value**
articles null
is there any particular reason why this isnt working? Where did I go wrong?