I have 2 DIV elements to be shown based on whether the user has logged in or not. I am using ng-hide and ng-show for the same.
<div id="forGuestUsers" ng-hide="isUserLoggedIn()">
</div>
<div id="forLoginUsers" ng-show="isUserLoggedIn()">
</div>
In my controller I have the below code to check if the user is logged in or not.I am using Parse for my backend data.
$scope.isUserLoggedIn = function() {
return Parse.User.current() !== null;
}
But this does not seem to work. The DIV related to guest is always shown even if the user has logged in.
What I should be doing to make this work? I am new to Ionic and I am in learning phase. Any solution on this would be of great help to me.