it's probably a rookie mistake but I am having trouble changing my page using:
$state.go('login');
My routing looks as following:
$stateProvider
.state('login', {
url: "/login",
templateUrl: "./auth/login.html",
controller: 'loginCtrl'
})
I also added a
$rootScope.$on("$stateChangeStart", function (event, next) {...}
just to check if it gets there after I use $state.go() and yes; it gets there but it does not change my page or URL at all. Changing the page works fine with ui-sref="login"
inside a view.html.
Other syntaxes I tried:
$state.go('login', null, {options: { location : true } } );
$state.go('login', {}, {location : true});
Btw, what I am trying to accomplish is redirecting to a login-page when the user is not authorized inside the $stageChangeStart-event.
Any ideas?