Book Image

Getting Started with Angular - Second edition - Second Edition

By : Minko Gechev
Book Image

Getting Started with Angular - Second edition - Second Edition

By: Minko Gechev

Overview of this book

Want to build quick and robust web applications with Angular? This book is the quickest way to get to grips with Angular and take advantage of all its new features.
Table of Contents (16 chapters)
Getting Started with Angular Second Edition
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

AoT compilation in Angular


In this section, we'll briefly explain what AoT compilation is in the context of Angular and what implication it may have on our projects, without going into deep technical details. 

The key focus in Angular is it's extremely fast change detection mechanism. After exploring different options for performing change detection, the Angular team discovered that the change detection mechanism used in AngularJS can be improved dramatically using code generation. It turns out that generating code, which performs change detection and rendering and on top of that is very well optimized for the JavaScript virtual machine, runs much faster compared to the traditional (also known as dynamic) change detection mechanism.

How code generation works

The Angular code generator is known as the Angular compiler. What it does is compile the templates of the Angular components to JavaScript or TypeScript (depending on the use case). When we compile the templates to TypeScript, we allow...