feat(router): add urlUpdateStrategy allow updating the browser URL at the beginning of navigation (#24820)

Fixes #24616

PR Close #24820
This commit is contained in:
Jason Aden
2018-07-10 09:44:15 -07:00
committed by Matias Niemelä
parent 4d8b8ad372
commit 328971ffcc
4 changed files with 141 additions and 73 deletions
+2
View File
@@ -121,6 +121,7 @@ export interface ExtraOptions {
preloadingStrategy?: any;
scrollOffset?: [number, number] | (() => [number, number]);
scrollPositionRestoration?: 'disabled' | 'enabled' | 'top';
urlUpdateStrategy?: 'deferred' | 'eager';
useHash?: boolean;
}
@@ -323,6 +324,7 @@ export declare class Router {
readonly routerState: RouterState;
readonly url: string;
urlHandlingStrategy: UrlHandlingStrategy;
urlUpdateStrategy: 'deferred' | 'eager';
constructor(rootComponentType: Type<any> | null, urlSerializer: UrlSerializer, rootContexts: ChildrenOutletContexts, location: Location, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Routes);
createUrlTree(commands: any[], navigationExtras?: NavigationExtras): UrlTree;
dispose(): void;