The AOT Cookbook sample was the starting point.
This sample runs in both JIT and AOT
With AOT you have to re-build after each change. With JIT you can develop on the fly as we usually do.
Look at sub.component.ts
to see the experiments in metadata inheritance.
The original source is in #3096 along with tools and configs to build it in JIT and AOT. You'll need knowledge of the Angular docs sample development practices to do it.
Commands to run:
# compile with AOT, then rollup. Noisy.
npm run build:aot
# start server and JIT/TS watching as usual
npm start
The browser displays the JIT version (index.html
) by default.
You can tell by looking at the browser tab (it says "JIT:..."), in the console, and in the page header.
To see the AOT version, put index-aot.html
in the address bar.
You can tell by looking at the browser tab (it says "AOT:..."), in the console, and in the page header.
I like to have two console windows open:
-
Running
npm start
(after once having runnpm run build:aot
) -
Where I periodically re-run either
npm run tsc
ornpm run build:aot
after a change that works in JIT