Mohd Kashif
What is AOT and how to use it in our project?
By Mohd Kashif in Angular on Mar 06 2019
  • Thirumalesh Gangula
    May, 2019 21

    Angular has two built-in compilation strategies1. JIT ( Just in time) 2. AOT ( Ahead of time)In JIT we need to download the Angular compiler into the client browser, which converts the Angular code into browser understandable Javascript. Angular compiler size is around 2 MB which requires some time for the browser to download into client machine.Whereas in AOT we do not require Angular compiler. During AOT step only code is converted into browser understandable Javascript. ng build --prod will internally make use of AOT compilation.Using AOT and Lazy loading module we can reduce the page rendering time in Angular.

    • 3
  • Mohd Kashif
    Mar, 2019 6

    AOT is 'Ahead of time'. In Angular 4, View Engine introduced, which decreased the size of generated code using 'AOT'. 'AOT' is Angular compiler. It's convert HTML and Typescript code into efficient JavaScript code during build Phase before browser download and run that code. AOT compilation is on build time - For AOT compilation, need to Add --aot flag in command. i.e, ng build --aot

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS