| 630 | } |
| 631 | |
| 632 | ngOnInit() { |
| 633 | if (this.radioGroup) { |
| 634 | // If the radio is inside a radio group, determine if it should be checked |
| 635 | this.checked = this.radioGroup.value === this._value; |
| 636 | |
| 637 | if (this.checked) { |
| 638 | this.radioGroup.selected = this; |
| 639 | } |
| 640 | |
| 641 | // Copy name from parent radio group |
| 642 | this.name = this.radioGroup.name; |
| 643 | } |
| 644 | |
| 645 | this._removeUniqueSelectionListener = this._radioDispatcher.listen((id, name) => { |
| 646 | if (id !== this.id && name === this.name) { |
| 647 | this.checked = false; |
| 648 | } |
| 649 | }); |
| 650 | } |
| 651 | |
| 652 | ngDoCheck(): void { |
| 653 | this._updateTabIndex(); |