Angular · Senior · Question 56 of 75

How do you make SSR wait for async work that isn't an HTTP request (e.g. a timer-based init)?

const pending = inject(PendingTasks);
pending.run(() => loadWidgetConfig());

Explanation

SSR serializes the page once the app is stable. Without zone.js, Angular can't see arbitrary promises, so long-lived work must be tracked explicitly.

Further reading

Problem with a question

Angular · Senior · question 56

Test yourself

Take the Angular · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz