docs(router): use pipe in activatedRoute example (#29752)
Copying the example, mentioned at Activated Route (https://angular.io/api/router/ActivatedRoute), to Stackblitz doesn't compile: https://stackblitz.com/edit/angular-x7pbeb? That's because the example does not use .pipe. I've updated the example to include `pipe`. PR Close #29752
This commit is contained in:
parent
84be7c52dc
commit
e682b4453c
|
@ -95,10 +95,10 @@ export function createEmptyStateSnapshot(
|
|||
* @Component({...})
|
||||
* class MyComponent {
|
||||
* constructor(route: ActivatedRoute) {
|
||||
* const id: Observable<string> = route.params.map(p => p.id);
|
||||
* const url: Observable<string> = route.url.map(segments => segments.join(''));
|
||||
* const id: Observable<string> = route.params.pipe(map(p => p.id));
|
||||
* const url: Observable<string> = route.url.pipe(map(segments => segments.join('')));
|
||||
* // route.data includes both `data` and `resolve`
|
||||
* const user = route.data.map(d => d.user);
|
||||
* const user = route.data.pipe(map(d => d.user));
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
|
|
Loading…
Reference in New Issue