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

Method ngAfterContentInit

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

Source from the content-addressed store, hash-verified

862 }
863
864 ngAfterContentInit() {
865 this._allDrawers.changes
866 .pipe(startWith(this._allDrawers), takeUntil(this._destroyed))
867 .subscribe((drawer: QueryList<MatDrawer>) => {
868 this._drawers.reset(drawer.filter(item => !item._container || item._container === this));
869 this._drawers.notifyOnChanges();
870 });
871
872 this._drawers.changes.pipe(startWith(null)).subscribe(() => {
873 this._validateDrawers();
874
875 this._drawers.forEach((drawer: MatDrawer) => {
876 this._watchDrawerToggle(drawer);
877 this._watchDrawerPosition(drawer);
878 this._watchDrawerMode(drawer);
879 });
880
881 if (
882 !this._drawers.length ||
883 this._isDrawerOpen(this._start) ||
884 this._isDrawerOpen(this._end)
885 ) {
886 this.updateContentMargins();
887 }
888
889 this._changeDetectorRef.markForCheck();
890 });
891
892 // Avoid hitting the NgZone through the debounce timeout.
893 this._ngZone.runOutsideAngular(() => {
894 this._doCheckSubject
895 .pipe(
896 debounceTime(10), // Arbitrary debounce time, less than a frame at 60fps
897 takeUntil(this._destroyed),
898 )
899 .subscribe(() => this.updateContentMargins());
900 });
901 }
902
903 ngOnDestroy() {
904 this._contentMarginChanges.complete();

Callers

nothing calls this directly

Calls 9

_validateDrawersMethod · 0.95
_watchDrawerToggleMethod · 0.95
_watchDrawerPositionMethod · 0.95
_watchDrawerModeMethod · 0.95
_isDrawerOpenMethod · 0.95
updateContentMarginsMethod · 0.95
markForCheckMethod · 0.80
resetMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected