Angular Universal and external apis Angular Universal and external apis angular angular

Angular Universal and external apis


When using angular universal, the SSR process will actually generate html that the browser will download, with some inline css so that the page is rendered quickly. After that, the browser will download the JS files for your angular app, and at this point, a transition occurs after which the client-side JS app takes control.

You can use external APIs. If you've got a call to your API in your angular code, (e.g. on component init) then that call will be performed server side; meaning that angular universal will wait for that call to complete so that it can use the data retrieved to generate the page's html


Also make sure that is calling the same API.

This are different routes:

  1. api/
  2. api