ExperimentalPendingTasks is an Angular injectable for delaying server-side rendering serialization while zoneless applications complete asynchronous work. section 10.3.5
Use it when Angular cannot infer that asynchronous work must finish before serialization:
- Inject ExperimentalPendingTasks and call add() to register pending work. section 10.3.5
- Await the asynchronous operation, such as credential refresh followed by navigation. section 10.3.5
- Call the returned cleanup function so Angular can continue serialization. section 10.3.5
const tasks = inject(ExperimentalPendingTasks); const cleanup = tasks.add(); await someAsyncTask(); cleanup();
The compact listing shows the registration, awaited operation, and cleanup sequence. section 10.3.5
