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

Method ngAfterContentInit

src/material/stepper/stepper.ts:227–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225 }
226
227 override ngAfterContentInit() {
228 super.ngAfterContentInit();
229 this._icons.forEach(({name, templateRef}) => (this._iconOverrides[name] = templateRef));
230
231 // Mark the component for change detection whenever the content children query changes
232 this.steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => this._stateChanged());
233
234 // Transition events won't fire if animations are disabled so we simulate them.
235 this.selectedIndexChange.pipe(takeUntil(this._destroyed)).subscribe(() => {
236 const duration = this._getAnimationDuration();
237 if (duration === '0ms' || duration === '0s') {
238 this._onAnimationDone();
239 } else {
240 this._isAnimating.set(true);
241 }
242 });
243
244 this._ngZone.runOutsideAngular(() => {
245 if (!this._animationsDisabled) {
246 setTimeout(() => {
247 // Delay enabling the animations so we don't animate the initial state.
248 this._elementRef.nativeElement.classList.add('mat-stepper-animations-enabled');
249
250 // Bind this outside the zone since it fires for all transitions inside the stepper.
251 this._cleanupTransition = this._renderer.listen(
252 this._elementRef.nativeElement,
253 'transitionend',
254 this._handleTransitionend,
255 );
256 }, 200);
257 }
258 });
259 }
260
261 override ngAfterViewInit(): void {
262 super.ngAfterViewInit();

Callers

nothing calls this directly

Calls 7

_getAnimationDurationMethod · 0.95
_onAnimationDoneMethod · 0.95
_stateChangedMethod · 0.80
setMethod · 0.80
listenMethod · 0.80
ngAfterContentInitMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected