Professional Documents
Culture Documents
JIT AOT: Ahead of Time (AOT) and Just in Time (JIT)
JIT AOT: Ahead of Time (AOT) and Just in Time (JIT)
JIT AOT
JIT
download
s the
compiler
and
compiles
code
exactly
before
Displayin
g in the AOT has already complied with the code while building your
browser. application, so it doesn’t have to compile at runtime.
Loading
in JIT is
slower
than the
AOT
because it
needs to
compile
your
applicatio
n at Loading in AOT is much quicker than the JIT because it already has
runtime. compiled your code at build time.
JIT is
more
suitable
for
developm
ent mode. AOT is much suitable in the case of Production mode.
Bundle
size is
higher
compare Bundle size optimized in AOT, in results AOT bundle size is half the
to AOT. size of JIT bundles.
You can To run your app in AOT you have to provide –aot at the end like:
run your
JIT AOT
app in JIT
with this
command:
ng build
OR ng
serve ng build --aot OR ng serve --aot
Types of directives
Component directives
These form the main class in directives. Instead of @Directive decorator we
use @Component decorator to declare these directives. These directives have a view,
a stylesheet and a selector property.