MCPcopy Index your code
hub / github.com/angular/angular / constructor

Method constructor

adev/src/app/features/not-found/not-found.ts:22–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 protected readonly searchResults = signal<SearchResultItem[]>([]);
21
22 constructor() {
23 const activatedRoute = inject(ActivatedRoute);
24 const searchTerms = this.extractSearchTerm(activatedRoute.snapshot.url);
25 if (searchTerms) {
26 // We're using the one-shot query request to not interfere with the main search signal
27 this.search.searchWithQuery(searchTerms).then((results) => {
28 this.searchResults.set(results ?? []);
29 });
30 }
31 }
32
33 private extractSearchTerm(url: UrlSegment[]): string {
34 return url.join(' ').replace(/[-_/]/g, ' ');

Callers

nothing calls this directly

Calls 5

extractSearchTermMethod · 0.95
injectFunction · 0.90
searchWithQueryMethod · 0.80
thenMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected