I have the below code and when i refresh the application the button is enabled state. I want the button to be in disabled state even after page refresh or logout from the application. Basically i need to save the state of the button. How can i do that?
//html
<div>
<input type="file" ng-disabled="false" id="id1">
</div>
//Controller
document.getElementById("id1").disabled = true;
You can use localStorage to save the state which is simple solution.
Store values for on page refresh and logout
Now you can add check for button disable, like this:
HTML:
JavaScript/Controller:
Anytime you want to enable the button then do this
$scope.isDisabled = false;