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

Method constructor

src/material/button-toggle/button-toggle.ts:676–690  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

674 new EventEmitter<MatButtonToggleChange>();
675
676 constructor() {
677 inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
678 const toggleGroup = inject<MatButtonToggleGroup>(MAT_BUTTON_TOGGLE_GROUP, {optional: true})!;
679 const defaultTabIndex = inject(new HostAttributeToken('tabindex'), {optional: true}) || '';
680 const defaultOptions = inject<MatButtonToggleDefaultOptions>(
681 MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS,
682 {optional: true},
683 );
684
685 this._tabIndex = signal<number | null>(parseInt(defaultTabIndex) || 0);
686 this.buttonToggleGroup = toggleGroup;
687 this._appearance =
688 defaultOptions && defaultOptions.appearance ? defaultOptions.appearance : 'standard';
689 this._disabledInteractive = defaultOptions?.disabledInteractive ?? false;
690 }
691
692 ngOnInit() {
693 const group = this.buttonToggleGroup;

Callers

nothing calls this directly

Calls 2

signalFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected