Unlike a JIT-Compiler (Just in time) the AOT-Compiler (Ahead of time) compiles the source code before the code is executed.
An Angular application consists largely of components and their HTML templates. Before the browser can render the application, the components and templates must be converted to executable JavaScript by an Angular compiler.
Angular offers two ways to compile your application:
- Just-in-Time (JIT), which compiles your app in the browser at runtime
- Ahead-of-Time (AOT), which compiles your app at build time.
JIT compilation is the default when you run the build-only or the build-and-serve-locally CLI commands:
ng build
ng serve
For AOT compilation, append the --aot flags to the build-only or the build-and-serve-locally CLI commands:
ng build --aot
ng serve --aot
For more information about Angular compilers read the official documentation