@Attribute in Angular

2018-09-25  本文已影响0人  forks1990

In Angular document it says: @Attribute is Attribute decorator and metadata, nothing useful.

@Attribute is @Input without binding

For @Input fields, angular runtime creates a binding, component get the updated value, and auto update.

@Attribute don't create the binding, value copied into component on first time, and that's all. Use @Attribute has a better performance, if the value is static.

上一篇下一篇

猜你喜欢

热点阅读