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

Method constructor

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

Source from the content-addressed store, hash-verified

212 }
213
214 constructor() {
215 inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
216 const tabIndex = inject(new HostAttributeToken('tabindex'), {optional: true});
217 const defaults = this.defaults;
218
219 this.tabIndex = tabIndex == null ? 0 : parseInt(tabIndex) || 0;
220 this.color = defaults.color || 'accent';
221 this.id = this._uniqueId = inject(_IdGenerator).getId('mat-mdc-slide-toggle-');
222 this.hideIcon = defaults.hideIcon ?? false;
223 this.disabledInteractive = defaults.disabledInteractive ?? false;
224 this._labelId = this._uniqueId + '-label';
225 }
226
227 ngOnInit() {
228 this._signalFormField = this._injector.get(FORM_FIELD, undefined, {optional: true, self: true});

Callers

nothing calls this directly

Calls 2

loadMethod · 0.80
getIdMethod · 0.45

Tested by

no test coverage detected