SignOut with reload Data

Hey guys!

I’m trying to create a simple logOut Controller which should clean all the variables in the app (using Tabs Template).

I have this:

.controller(‘SignOutCtrl’, function($scope, $state, $rootScope) {
console.log("SignOut ");

if ($rootScope.flag == 1) {
    Parse.User.logOut();
    $rootScope.flag = 0;
    location.reload();
}

$state.go('signin');

})

In my SignIn Controller I’m setting the $rootScope.flag = 1 after the login is successful, I’m doing that because the location.reload() forced my app into a loop (if you have a better solution would be great to hear about it!)

But it’s only working the first time I call this controller (SignOut), the second one it’s doing nothing, the app only shows a blank page, and I don’t see the console log “SignOut” neither.

The problem seems to be that the SignOutCtrl is executed only once, how can I force to reload it again? I thought with location.reload() was realoding the whole app.

Any help will be more than good!

Thanks in advance