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

Method ngAfterViewInit

src/material/sidenav/drawer.ts:494–509  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

492 }
493
494 ngAfterViewInit() {
495 this._isAttached = true;
496
497 // Only update the DOM position when the sidenav is positioned at
498 // the end since we project the sidenav before the content by default.
499 if (this._position === 'end') {
500 this._updatePositionInParent('end');
501 }
502
503 // Needs to happen after the position is updated
504 // so the focus trap anchors are in the right place.
505 if (this._platform.isBrowser) {
506 this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
507 this._updateFocusTrapState();
508 }
509 }
510
511 ngOnDestroy() {
512 this._eventCleanups.forEach(cleanup => cleanup());

Callers

nothing calls this directly

Calls 3

_updateFocusTrapStateMethod · 0.95
createMethod · 0.45

Tested by

no test coverage detected