feat(router): add UrlSegment[] to CanLoad interface (#13127)

CanLoad now defines UrlSegment[] as a second parameter of the function.
Users can store the initial url segments and refer to them later, e.g. to go
back to the original url after authentication via router.navigate(urlSegments).
Existing code still works as before because the second function parameter
does not have to be defined.

Closes #12411

PR Close #13127
This commit is contained in:
Marcus Krahl
2017-07-19 20:48:39 +02:00
committed by Jason Aden
parent 116946fb11
commit 07d8d3994c
4 changed files with 85 additions and 22 deletions

View File

@ -66,7 +66,7 @@ export interface CanDeactivate<T> {
}
export interface CanLoad {
canLoad(route: Route): Observable<boolean> | Promise<boolean> | boolean;
canLoad(route: Route, segments: UrlSegment[]): Observable<boolean> | Promise<boolean> | boolean;
}
/** @experimental */