angular2中的装饰器在组件中做什么? [英] what does decorators in angular2 do in components?

查看:75
本文介绍了angular2中的装饰器在组件中做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

angular2中的装饰器有什么用?它有什么作用?
喜欢在设计时注释和修改类和属性。
这听起来很像什么注释正确?
您能解释一下吗?
预先感谢。

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.

推荐答案

它提供有关组件,指令,管道和依赖项注入的元信息。

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.

构建工具将

另请参见如何在Typescript中编译装饰器(注释)?

这篇关于angular2中的装饰器在组件中做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆