| 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}); |