MCPcopy Index your code
hub / github.com/angular/angular / whenStable

Method whenStable

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

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

()

Source from the content-addressed store, hash-verified

336 * @returns A promise that resolves when the application becomes stable
337 */
338 whenStable(): Promise<void> {
339 let subscription: Subscription;
340 return new Promise<void>((resolve) => {
341 subscription = this.isStable.subscribe({
342 next: (stable) => {
343 if (stable) {
344 resolve();
345 }
346 },
347 });
348 }).finally(() => {
349 subscription.unsubscribe();
350 });
351 }
352
353 private readonly _injector = inject(EnvironmentInjector);
354 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