MCPcopy
hub / github.com/angular/components / ngAfterContentInit

Method ngAfterContentInit

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

Source from the content-addressed store, hash-verified

842 }
843
844 ngAfterContentInit() {
845 this._allDrawers.changes
846 .pipe(startWith(this._allDrawers), takeUntil(this._destroyed))
847 .subscribe((drawer: QueryList<MatDrawer>) => {
848 this._drawers.reset(drawer.filter(item => !item._container || item._container === this));
849 this._drawers.notifyOnChanges();
850 });
851
852 this._drawers.changes.pipe(startWith(null)).subscribe(() => {
853 this._validateDrawers();
854
855 this._drawers.forEach((drawer: MatDrawer) => {
856 this._watchDrawerToggle(drawer);
857 this._watchDrawerPosition(drawer);
858 this._watchDrawerMode(drawer);
859 });
860
861 if (
862 !this._drawers.length ||
863 this._isDrawerOpen(this._start) ||
864 this._isDrawerOpen(this._end)
865 ) {
866 this.updateContentMargins();
867 }
868
869 this._changeDetectorRef.markForCheck();
870 });
871
872 // Avoid hitting the NgZone through the debounce timeout.
873 this._ngZone.runOutsideAngular(() => {
874 this._doCheckSubject
875 .pipe(
876 debounceTime(10), // Arbitrary debounce time, less than a frame at 60fps
877 takeUntil(this._destroyed),
878 )
879 .subscribe(() => this.updateContentMargins());
880 });
881 }
882
883 ngOnDestroy() {
884 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