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

Method constructor

src/dev-app/icon/icon-demo.ts:20–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18})
19export class IconDemo {
20 constructor() {
21 const iconRegistry = inject(MatIconRegistry);
22 const sanitizer = inject(DomSanitizer);
23
24 iconRegistry
25 .addSvgIcon(
26 'thumb-up',
27 sanitizer.bypassSecurityTrustResourceUrl('/icon/assets/thumbup-icon.svg'),
28 )
29 .addSvgIconLiteral('bike', sanitizer.bypassSecurityTrustHtml(BIKE_ICON))
30 .addSvgIconSetInNamespace(
31 'core',
32 sanitizer.bypassSecurityTrustResourceUrl('/icon/assets/core-icon-set.svg'),
33 )
34 .addSvgIconSetLiteralInNamespace(
35 'core-inline',
36 sanitizer.bypassSecurityTrustHtml(INLINE_ICON_SET),
37 )
38 .registerFontClassAlias('fontawesome', 'fa');
39 }
40}
41
42const BIKE_ICON =

Callers

nothing calls this directly

Calls 5

addSvgIconLiteralMethod · 0.45
addSvgIconMethod · 0.45

Tested by

no test coverage detected