How code generation works
The Angular code generator is known as the Angular compiler. It compiles the templates of the Angular components to JavaScript or TypeScript (depending on the compilation target). When we compile the templates to TypeScript, we allow the TypeScript compiler to perform type checking, not only within the imperative logic of our components, directives, services, and pipes, but also in the components' templates! Performing type checking in the templates helps us find even more potential issues in our application.
On top of code generation for templates, the Angular compiler also generates code for the injectors in our application. This improves the performance of the dependency injection mechanism even further.
Based ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access