Skip to Content
Beginning Server-Side Application Development with Angular
book

Beginning Server-Side Application Development with Angular

by Bram Borggreve
April 2018
Intermediate content levelIntermediate
110 pages
2h 12m
English
Packt Publishing
Content preview from Beginning Server-Side Application Development with Angular

Adding Dependencies for the Server App

In order to get our server app working correctly, we need to make sure we load two of Angular's dependencies: zone.js and reflect-metadata.

Our browser app loads these dependencies using polyfills.ts, and for the server app, we will add them to src/main.server.ts.

Another dependency that we need to add is the ModuleMapLoaderModule. This is a third-party module that is needed to make Angular Universal apps work with lazy loading.

We will import two dependencies in src/main.server.ts so that they are imported when the AppServerModule is loaded.

Additionally, we will enable production mode, just like it's done for the browser app in src/main.ts:

  1. Open the newly created file src/main.server.ts.
  2. Add the imports at the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Server-Side Enterprise Development with Angular

Server-Side Enterprise Development with Angular

Bram Borggreve
Building Large-Scale Web Applications with Angular

Building Large-Scale Web Applications with Angular

Chandermani Arora, Kevin Hennessy, Christoffer Noring, Doguhan Uluca
Angular UI Development with PrimeNG

Angular UI Development with PrimeNG

Oleg Varaksin, Sudheer Jonna

Publisher Resources

ISBN: 9781789342161Supplemental Content