Can Angular Universal perform http requests from the server to build the page before responding to the client

Viewed 667

Can Angular Universal render a page on the server that fetches data via HTTPClient requests so that the browser does not make those requests?

Background:

We're looking at reusing some of our Angular components in a new project which is not intended to fetch data once it has been sent to the user's browser. I think this is a job for Angular Universal but every single tutorial I have found creates a basic Angular app in which all the data is hardcoded and no data is ever fetched. This page refers to the duplication of HTTP requests so I believe it can be done.

Similar questions I have found on SO suggest that if you're just rendering HTML from the server and want no JS running in the browser, it might be worth considering another framework. Since we've created the look and feel we want and will continue to maintain the client-side-JS components we'd like to stick with Angular.

0 Answers
Related