Ahead-of-time compilation compiles an Angular application before deployment or execution. The production build transforms templates into precompiled commands that the browser can execute directly, avoiding template compilation at runtime. section 9.2.3
Angular uses different compilation strategies for development and deployment:
- Runs just-in-time compilation with ng serve, making development builds faster while shifting template compilation into the browser. section 9.2.3
- Runs ahead-of-time compilation with ng build, producing a precompiled application for production execution. section 9.2.3
- Supports server-side rendering because Angular-generated template commands are verified as platform-agnostic and can run on the server and browser. section 9.2.3
Production deployment
After development with ng serve, run ng build to obtain a precompiled application. The deployed browser receives compiled rendering commands rather than compiling Angular templates during execution. section 9.2.3


