March 2017
Intermediate to advanced
118 pages
2h 1m
English
The router assigns a unique ID to every navigation, which we can use to correlate events. Perform the following steps.
function isStart(e: Event): boolean {
return e instanceof NavigationStart;
}
function isEnd(e: Event): boolean {
return e instanceof NavigationEnd ||
e instanceof NavigationCancel ||
e instanceof NavigationError;
}
function collectAllEventsForNavigation(obs: Observable): Observable<Event[]>{ let observer: Observer<Event[]>; const events = []; const sub = obs.subscribe(e ...Read now
Unlock full access