Why does Angular 2 use decorators?
问题 I just started using Angular 2 and was wondering why some properties like selector and template are put in components decorators and not in components classes. What's the point of using all these decorators in Angular 2? 回答1: To make it easy for tools to provide all kinds of support in templates like: error checking auto-completion graphical GUI designers To generate code from decorators which allows: to define some things more declaratively or generate different code depending on some