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

Method ngAfterViewInit

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

Source from the content-addressed store, hash-verified

654 }
655
656 ngAfterViewInit() {
657 this._updateTabIndex();
658 this._focusMonitor.monitor(this._elementRef, true).subscribe(focusOrigin => {
659 if (!focusOrigin && this.radioGroup) {
660 this.radioGroup._touch();
661 }
662 });
663
664 // We bind this outside of the zone, because:
665 // 1. Its logic is completely DOM-related so we can avoid some change detections.
666 // 2. There appear to be some internal tests that break when this triggers a change detection.
667 this._ngZone.runOutsideAngular(() => {
668 this._cleanupClick = this._renderer.listen(
669 this._inputElement.nativeElement,
670 'click',
671 this._onInputClick,
672 );
673 });
674 }
675
676 ngOnDestroy() {
677 this._cleanupClick?.();

Callers

nothing calls this directly

Calls 4

_updateTabIndexMethod · 0.95
_touchMethod · 0.80
listenMethod · 0.80
monitorMethod · 0.45

Tested by

no test coverage detected