()
| 690 | } |
| 691 | |
| 692 | ngOnInit() { |
| 693 | const group = this.buttonToggleGroup; |
| 694 | this.id = this.id || this._idGenerator.getId('mat-button-toggle-'); |
| 695 | |
| 696 | if (group) { |
| 697 | if (group._isPrechecked(this)) { |
| 698 | this.checked = true; |
| 699 | } else if (group._isSelected(this) !== this._checked) { |
| 700 | // As side effect of the circular dependency between the toggle group and the button, |
| 701 | // we may end up in a state where the button is supposed to be checked on init, but it |
| 702 | // isn't, because the checked value was assigned too early. This can happen when Ivy |
| 703 | // assigns the static input value before the `ngOnInit` has run. |
| 704 | group._syncButtonToggle(this, this._checked); |
| 705 | } |
| 706 | } |
| 707 | } |
| 708 | |
| 709 | ngAfterViewInit() { |
| 710 | // This serves two purposes: |
nothing calls this directly
no test coverage detected