MCPcopy Create free account
hub / github.com/angular/components / constructor

Method constructor

docs/src/app/pages/guide-viewer/guide-viewer.ts:36–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 guide = signal<GuideItem | undefined>(undefined);
35
36 constructor() {
37 const _route = inject(ActivatedRoute);
38 const guideItems = this.guideItems;
39
40 _route.params.subscribe(p => {
41 const guideItem = guideItems.getItemById(p['id']);
42 if (guideItem) {
43 this.guide.set(guideItem);
44 }
45
46 if (!this.guide()) {
47 this._router.navigate(['/guides']);
48 }
49 });
50 }
51
52 ngOnInit(): void {
53 if (this.guide() !== undefined) {

Callers

nothing calls this directly

Calls 2

setMethod · 0.80
getItemByIdMethod · 0.45

Tested by

no test coverage detected