feat(router): add a Navigation type available during navigation (#27198)

Provides target URLs, Navigation, and `NavigationExtras` data.

FW-613

PR Close #27198
This commit is contained in:
Jason Aden
2018-11-29 10:07:24 -08:00
committed by Igor Minar
parent 73f6ed9be1
commit d40af0c137
6 changed files with 186 additions and 49 deletions

View File

@ -87,14 +87,14 @@ import {UrlTree} from '../url_tree';
* </a>
* ```
*
* And later the value can be read from the router through `router.getCurrentTransition.
* And later the value can be read from the router through `router.getCurrentNavigation.
* For example, to capture the `tracingId` above during the `NavigationStart` event:
*
* ```
* // Get NavigationStart events
* router.events.pipe(filter(e => e instanceof NavigationStart)).subscribe(e => {
* const transition = router.getCurrentTransition();
* tracingService.trace({id: transition.extras.state});
* const navigation = router.getCurrentNavigation();
* tracingService.trace({id: navigation.extras.state.tracingId});
* });
* ```
*