How can I display edit and delete buttons only when local storage is not empty?
In my view.html file, I attempted the following:
<div ng-controller="MainController">
<button ng-disabled="localStorage.getItem('wimmtkey') !== null" > Edit</button>
</div>
Then in the review.controller.js file, I have the following function:
function submit() {
if($rootScope.name!=null) {
var temp={
"name":$rootScope.name,
"surname":$rootScope.surname,
"email":$rootScope.email
}
$scope.localArray.push(temp);
localStorageService.set("wimmtkey", $scope.localArray);
$scope.obtained_array = localStorageService.get("wimmtkey");
var Results = UniversalService.PostReview(JSON.stringify(JSONObject));
}
}
However, the button always remains visible even when using incognito mode. What could be causing this issue?