angular-route-segment
angular-route-segment copied to clipboard
Change location before template is fired
Good day, @artch !
I want to change location before template is fired.
So I get authorization status via resolve via $http and do $location.path('/login') in controller. But template is fired before location changed instead.
Can you help me please?
$routeSegmentProvider.when("/login", "login") .segment('login', { default: true, resolve:{ data:loginAccess, templateUrl: 'login/signin.html', controller: "LoginCtrl", }, untilResolved:{ template:"" }, resolveFailed:{ template:"<h1>failed</h1>", } })
use option "resolve" and "untilResolved"