Parse User Validation Not Working

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 id="forLoginUsers" ng-show="isUserLoggedIn()">

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.

I have tried directly to use the condition in ng-show/ng-hide. But still no luck.

<div id="forLoginUsers" ng-show=" Parse.User.current() !== null">

Try “!===” because NULL - typeof have to be

!=== is not a valid syntax as per my limited knowledge on JavaScript.

If this not working try

<div id="forLoginUsers" ng-show=" Parse.User.current() !== 'null' ">

I solve this by a different method. Thanks for your time.

how did you solve this?

I will get you the exact code when I get home.