I am using AngularJs and Ui-Router and I am trying to set two different home pages, one for users that are logged in and the other for users that aren\'t. But I am getting t
Use $state.go("main", {}, {notify:false}); for not notify to "$stateChangeStart"event.
// NOT authenticated - wants any private stuff
if(shouldLogin)
{
$state.go("main", {}, {notify:false});
event.preventDefault();
return;
}
// authenticated (previously) comming not to root main
if(Auth.isLoggedIn)
{
var shouldGoToMain = fromState.name === ""
&& toState.name !== "main" ;
if (shouldGoToMain)
{
$state.go("main", {}, {notify:false});
event.preventDefault();
}
return;
}