@Attribute in Angular

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.

你可能感兴趣的:(@Attribute in Angular)