From e682b4453ce39b751a16a9e8765b578e44c8249c Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Sun, 7 Apr 2019 10:27:38 +0200 Subject: [PATCH] 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 --- packages/router/src/router_state.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/router/src/router_state.ts b/packages/router/src/router_state.ts index f7bf56531d..2f1d30fb6d 100644 --- a/packages/router/src/router_state.ts +++ b/packages/router/src/router_state.ts @@ -95,10 +95,10 @@ export function createEmptyStateSnapshot( * @Component({...}) * class MyComponent { * constructor(route: ActivatedRoute) { - * const id: Observable = route.params.map(p => p.id); - * const url: Observable = route.url.map(segments => segments.join('')); + * const id: Observable = route.params.pipe(map(p => p.id)); + * const url: Observable = 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)); * } * } * ```