MCPcopy Create free account
hub / github.com/angular/angular / whenStable

Method whenStable

packages/core/src/application/application_ref.ts:349–362  ·  view source on GitHub ↗

* @returns A promise that resolves when the application becomes stable

()

Source from the content-addressed store, hash-verified

347 * @returns A promise that resolves when the application becomes stable
348 */
349 whenStable(): Promise<void> {
350 let subscription: Subscription;
351 return new Promise<void>((resolve) => {
352 subscription = this.isStable.subscribe({
353 next: (stable) => {
354 if (stable) {
355 resolve();
356 }
357 },
358 });
359 }).finally(() => {
360 subscription.unsubscribe();
361 });
362 }
363
364 private readonly _injector = inject(EnvironmentInjector);
365 private _rendererFactory: RendererFactory2 | null = null;

Callers

nothing calls this directly

Calls 4

finallyMethod · 0.80
subscribeMethod · 0.65
unsubscribeMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected