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

Method constructor

src/material/slide-toggle/slide-toggle.ts:209–220  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

207 }
208
209 constructor() {
210 inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
211 const tabIndex = inject(new HostAttributeToken('tabindex'), {optional: true});
212 const defaults = this.defaults;
213
214 this.tabIndex = tabIndex == null ? 0 : parseInt(tabIndex) || 0;
215 this.color = defaults.color || 'accent';
216 this.id = this._uniqueId = inject(_IdGenerator).getId('mat-mdc-slide-toggle-');
217 this.hideIcon = defaults.hideIcon ?? false;
218 this.disabledInteractive = defaults.disabledInteractive ?? false;
219 this._labelId = this._uniqueId + '-label';
220 }
221
222 ngAfterContentInit() {
223 this._focusMonitor.monitor(this._elementRef, true).subscribe(focusOrigin => {

Callers

nothing calls this directly

Calls 2

loadMethod · 0.80
getIdMethod · 0.45

Tested by

no test coverage detected