我是新來的角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指令和屬性指令' –