I am currently developing an Ionic application and encountering some issues with the ng-hide directive. My goal is to display or hide a button based on whether the user has completed registration.
The button in question:
<button class="button button-clear button-block button-positive button-register"
ui-sref="register" ng-hide="register.haveRegistered">
Register
</button>
Once a user registers, a property is set in local storage indicating this action (handled by another controller):
$storage.set("registrationRequested", true);
When the user navigates back to the login screen - where the button should be hidden - the following controller is activated:
$scope.register = {
'haveRegistered' : false
};
$scope.register.haveRegistered = $storage.get("registrationRequested", false)
Initially, the button is displayed as intended. However, after the user completes registration and I update the indicator in local storage, then return to the login page using $state.go('login');
, the ng-hide directive does not seem to work properly. Any suggestions?