In my angularjs app, I am checking if user lands on landing page and is already authenticated, then redirect him to home page.
.state(\'landingpage\', {
Anyway resolve waiting for promise state . Best thing what you can do is return promise and add timeout for your state:
resolve: {
AutoLoginCheck: ['$state', '$window', '$timeout', '$q', function ($state, $window, $timeout, $q) {
var deferred = $q.defer();
if(user.isLogin()){
deferred.resolve();
}else{
$timeout(function(){
$state.go('app.home');
}
deferred.reject();
}
return deferred.promise;
}]