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

Method constructor

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

Source from the content-addressed store, hash-verified

203 }
204
205 constructor() {
206 inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
207 const tabIndex = inject(new HostAttributeToken('tabindex'), {optional: true});
208 const defaults = this.defaults;
209
210 this.tabIndex = tabIndex == null ? 0 : parseInt(tabIndex) || 0;
211 this.color = defaults.color || 'accent';
212 this.id = this._uniqueId = inject(_IdGenerator).getId('mat-mdc-slide-toggle-');
213 this.hideIcon = defaults.hideIcon ?? false;
214 this.disabledInteractive = defaults.disabledInteractive ?? false;
215 this._labelId = this._uniqueId + '-label';
216 }
217
218 ngAfterContentInit() {
219 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