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

Method constructor

src/material/badge/badge.ts:169–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167 private _document = inject(DOCUMENT);
168
169 constructor() {
170 const config = inject(MAT_BADGE_CONFIG, {optional: true});
171 const styleLoader = inject(_CdkPrivateStyleLoader);
172 styleLoader.load(_MatBadgeStyleLoader);
173 styleLoader.load(_VisuallyHiddenLoader);
174
175 this._color = config?.color || 'primary';
176 this.overlap = config?.overlap ?? true;
177 this.position = config?.position || 'above after';
178 this.size = config?.size || 'medium';
179
180 if (typeof ngDevMode === 'undefined' || ngDevMode) {
181 const nativeElement = this._elementRef.nativeElement;
182
183 if (nativeElement.nodeType !== nativeElement.ELEMENT_NODE) {
184 throw Error('matBadge must be attached to an element node.');
185 }
186 }
187 }
188
189 /** Whether the badge is above the host or not */
190 isAbove(): boolean {

Callers

nothing calls this directly

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected