December 2017
Beginner
372 pages
10h 32m
English
The best use case of decorators is available in Angular implementation. We have been using decorators since Chapter 2, Our First Application – Sport News Combinator, when we created our first component, NewsComponent. In Angular, we have used the class decorators to help identify the component and its metadata. The following is the decorator used in NewsComponent:
@Component({ selector: 'snc-news', templateUrl: './news.component.html', styleUrls: ['./news.component.css']})export class NewsComponent
As we can see in the preceding code, we have a decorator named Component, which is of the type class Component and has multiple parameters associated with it. Some of the parameters that we use often are selector, templateUrl ...
Read now
Unlock full access