what does decorators in angular2 do in components?

南楼画角 提交于 2019-12-13 02:49:43

问题


What is the use of the decorators in angular2 ? What does it do? like to annotate and modify classes and properties at design time. This sounds pretty much like what annotations do right? Could you explain this ? Thanks in advance.


回答1:


It provides meta information for components, directives, pipes, and for dependency injection.

They can be used by tools for linting and auto-completion and other design tools.

Build tools will generate code (or HTML/CSS) from them.

See also How are decorators (annotations) compiled in Typescript?



来源:https://stackoverflow.com/questions/35431346/what-does-decorators-in-angular2-do-in-components

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!