MCPcopy
hub / github.com/rx-angular/rx-angular / DynamicPageComponent

Class DynamicPageComponent

apps/ssr-isr/src/app/dynamic.component.ts:27–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 changeDetection: ChangeDetectionStrategy.OnPush,
26})
27export class DynamicPageComponent {
28 private http = inject(HttpClient);
29
30 private postId$ = inject(ActivatedRoute).params.pipe(
31 map((p) => p['id'] as string),
32 );
33
34 post$ = this.postId$.pipe(
35 switchMap((id) =>
36 this.http.get<{ title: string; body: string }>(
37 `https://jsonplaceholder.typicode.com/posts/${id}`,
38 ),
39 ),
40 );
41}

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected