Hello everyone, I have a little question regarding the routing.
lets say I have a login page and 2 pages after the login, in these pages I always need to check if the user is logged in right? so in order to do this I’m doing this:
this is my controller one for the first page after login
function Controller_ONE($scope, $reactive, $state)
$reactive(this).attach($scope);
if(Meteor.user()){
$state.go('login');
}
}
function Controller_TWO($scope, $reactive, $state) {
$reactive(this).attach($scope);
if(Meteor.user()){
$state.go('login');
}
}
but this check is executed just once (the first time I see the page), if I go to the 2nd page and then again to the first one it doesn’t work.
i think this is caused because it is being executed on the first time that the file is loaded (when you actually see the page) but after that you wont load that file anymore, just execute the functions that are inside of the file.
Best regards, Prince.