Answer the question
In order to leave comments, you need to log in
How to change state in ui-route?
First, I define the states in the main application module:
$urlRouterProvider.otherwise("/fake");
$stateProvider
.state("loading", {
views : {
"" : {
templateUrl : "partials/loading.html",
controller : "AppLoaderController"
}
}
})
.state("fake", {
url: "/fake",
templateUrl : "partials/fake.html",
controller : "AppFakeController"
})
...
.run(["$state" , "$urlRouter", function( $state , $urlRouter ) {
if( !Config.loaded ) {
$state.transitionTo('loading')
}
}]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question