Skip to content
masterclass Buddy

Angular · Concept

Lazy loading

Angular's injectAsync helper loads an auto-provided service only when it is needed. It returns a function that resolves to the service instance through a promise.

Last updated

Syntax

function injectAsync<T>(loader: () => Promise<ProviderToken<T>>, options?: InjectAsyncOptions | undefined): () => Promise<T>;

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • InjectAsyncOptions
  • ProviderToken
  • onIdle
  • @Injectable({providedIn: 'root'})
  • @Service()

Source: injectAsync • Angular. Checked 2026-11-03.