Skip to content

kamilkisiela/angular-async-ssr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-async-ssr

How to make an async operation to be SSR friendly (angular universal)

Background

An Application bootstraps when it turns to be stable (ApplicationRef.isStable). It happens on few cases. One of them is when there's no pending MacroTasks (NgZone.hasPendingMacrotasks).

Let's say you do a basic async request, for example using Fetch API. It's being scheduled as a MicroTask which means Angular treats it as something not important to wait for.

Schedule MacroTask

A solution could be to schedule a MacroTask. Take a look at an example implementation.

About

How to make an async operation to be SSR friendly (angular universal)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published