Ui-Router $state.go inside $on('$stateChangeStart') is cauzing an infinite loop

前端 未结 6 1812
南方客
南方客 2020-12-03 10:52

I\'m trying to introduce login into the way the user navigates accross the application.

I pretend to redirect the user to the page were he was before he navigate to

6条回答
  •  旧巷少年郎
    2020-12-03 11:44

    This answer helped me:

    $urlRouterProvider.otherwise( function($injector, $location) {
                var $state = $injector.get("$state");
                $state.go("app.home");
            });
    

    Original: Why does AngularJS with ui-router keep firing the $stateChangeStart event?

提交回复
热议问题