Annotations 

Annotations are a new feature of TypeScript. They are symbols, prefixed with the @ sign, that we add to our code (that is, used to decorate our classes). Annotations can appear at the top of our class declaration, or at the top of our functions, or even on top of our class properties. What annotations do, generally speaking, is inject boilerplate code where they are attached (that is, our class, function, or properties). While we don't need annotations, since we can choose to write the boilerplate code ourselves, we're better off leveraging them because the boilerplate code shouldn't have to be written over and over again. Additionally, by using annotations instead of handwriting the boilerplate code, not only is the drudgery removed, but we don't have error-prone code to contend with. We'll see more annotations in various chapters of the book, but let's focus on the @Component and @NgModule decorators for this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.142.248