angular-route-segment icon indicating copy to clipboard operation
angular-route-segment copied to clipboard

Change location before template is fired

Open kuraga opened this issue 11 years ago • 2 comments

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?

kuraga avatar Jun 29 '14 16:06 kuraga

$routeSegmentProvider.when("/login", "login") .segment('login', { default: true, resolve:{ data:loginAccess, templateUrl: 'login/signin.html', controller: "LoginCtrl", }, untilResolved:{ template:"" }, resolveFailed:{ template:"<h1>failed</h1>", } })

osielcc avatar Jul 24 '17 21:07 osielcc

use option "resolve" and "untilResolved"

osielcc avatar Jul 24 '17 21:07 osielcc