angularjs - angular $state.reload not working -


i have state set logging out user. have set this:

.config(['$stateprovider', function ($stateprovider) {      // set states     $stateprovider.state('login', {         url: '/account/login',         templateurl: 'app/account/login/login.tpl.html',         controller: 'logincontroller',         controlleras: 'controller'     }).state('logout', {         url: '/account/logout',         resolve: {             logout: ['$state', 'accountservice', function ($state, account) {                 console.log('start logging out');                 account.logout();                 console.log('logging out');                 console.log($state);                 $state.go('login');                 console.log('logged out');             }]         }     }); }]) 

when navigate logout state console.logs hit, $state not change. have tried several things:

$state.go('login', {}, { reload: true }); 

and

$state.go($state.current, {}, { reload: true }); 

and

$state.reload(); 

but no matter 1 try, can not $state change correct state.

does know why?

update

so have changed state this:

}).state('logout', {     url: "/account/logout",     templateurl: '/app/account/logout.tpl.html', // if don't have template state not change in our resolve     resolve: {         logout: ['$state', 'accountservice', function ($state, account) {             account.logout();             console.log('logging out');             $state.go('login');         }]     } }); 

and still isn't going login screen. console logging logging out bit , if refresh page logged out, code working fine. doesn't doesn't redirect...

there no template in logout state is changing state there's no visual change keeps showing same view. verify url changing if want 110% sure state changing.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -