What do you mean by AOT (Ahead-Of-Time) Compilation?

In this blog, we are going to discuss AOT. The AOT stands for the Ahead-Of-Time.

An angular application consists of components and templates that a browser cannot understand. Therefore, every Angular application needs to be compiled before running inside the browser. The Angular compiler takes in the JS code, compiles it, and then produces some JS code. It is known as AOT compilation and happens only once per occasion per user.

Ahead-of-Time (AOT) is a type of compilation that compiles your app at build time.

ng build –aot
ng serve –aot

Angular provides the two types of compilation are as follows:

  1. JIT: JIT refers to the Just-in-Time compilation. The application compiles inside the browser during runtime.
  2. AOT: AOT refers to the Ahead-of-Time compilation. the application compiles during the build time.

Advantages of AOT compilation:

  • Fast Rendering
  • Fewer Ajax Requests
  • Minimizing Errors
  • Better Security

So, thanks for following this blog, and if you need any help please leave your queries in the comment box we will be happy to help you.

hexpoundsofttechsolution f