After I've read the documentation, I really thought it's an out of the box solution, plug and play or such, but boy was I wrong.
Anyways, let's get started. If you want to find the repo for an angular universal starter project, made ready for 2022, check this out.
Angular universal, out of the box, comes with some issues on it:
- It duplicates the http requests
- It has no clear way of sending data from the server to the client
LET'S GET IT ON!!!
With this starter you will have the following 9 useful features:
- Prevent duplicate http requests on server and client
- Use tokens to pass actual values computed on the server, to the client, at APP_INIT
- Have a TransferStateService to use from in passing data from the server to the client
- Have a middleware that points to an url of your choosing
- Take values from .env file and pass them to the server and client
- Have an ngrx store with beginning of a structure
- Have implemented the angular-svg-icon module
- Have the beginning of an scss structure and the way to import scss files in your components, without errors on the server
- Have eslint setup on the project
I won't be writing anymore code on this, but you can find the repo here and I'll walk you trough the project in the below video.