Skip to main content

Posts

Showing posts with the label AOT and JIT Angular

What is the difference between AOT and JIT Angular?

AOT (Ahead-of-Time) and JIT (Just-in-Time) are two compilation strategies used in Angular. Ahead-of-Time (AOT) Compilation : In AOT, the Angular application is compiled during the build process and the compiled code is delivered to the browser. The advantage of AOT is that the application runs faster because the compiler has already transformed the code into JavaScript, making it easier for the browser to execute. Additionally, with AOT, the compiler can perform optimizations such as tree-shaking (eliminating unused code) and dead-code elimination. AOT also provides better security by preventing injection attacks, as the compiled code is less susceptible to tampering. Ahead-of-Time (AOT) : Compiles your application and libraries at build time. This is the default starting in Angular 9.   Just-in-Time (JIT) Compilation : In JIT, the Angular application is compiled in the browser, during runtime. This means that the application is compiled just before it is executed. The ad...