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

Method ngOnInit

src/material/radio/radio.ts:632–650  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

listenMethod · 0.80

Tested by

no test coverage detected