我是新来的角2角2 HTML指令和属性指令
是否有人可以解释html directives and attribute directives
之间的区别?为什么他们都需要?
例子:
<rating [rate]="rate" (rate-change)="onUpdate($event)"></rating>
所以:
rating
就是我所谓的 “HTML指令”,但我不知道那是什么呢?
[rate]
是一个属性指令,用于设置名为“rate”的组件属性。
(rate-change)
是一个属性指令,它调用一个名为rateChange
的组件方法。
任何其他类型的directives
?
我的意思是'html指令和属性指令' –