asotog asotog - 1 month ago 14
TypeScript Question

What's the main purpose of platform-server module in Angular 2?

When looking AOT (ahead of time compilation) docs https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#compile , there is a dependency on platform-server , what is the purpose of it ? seems only compiler-cli required to run the compiler tool

Answer

The @angular/platform-server provides the server platform that supports the runtime compiler and it only as a dependency of compiler-cli. In the future, we will be installing compiler-cli that don't need it as here.