Angular Universal is a Pre-Rendering solution for Angular.
Why Angular Universal?
- Facilitate web crawlers through search engine optimization (SEO)
- Improve performance on mobile and low-powered devices
- Show the first page quickly with a first-contentful paint (FCP)
Add Universal rendering with the Angular CLI
ng generate universal --client-project <name of your client project>
Build the Angular Universal Bundle
ng run your-project-name:server
Start Universal App
npm run build:ssr && npm run serve:ssr
Creating server-side app module
ng add @nguniversal/express-engine --clientProject <name of your project>
npm run dev:ssr