【发布时间】:2016-08-14 23:49:13
【问题描述】:
我是 Angular 2 的新手。
有人能解释一下html directives and attribute directives 之间的区别吗?为什么它们都需要?
示例:
<rating [rate]="rate" (rate-change)="onUpdate($event)"></rating>
所以:
rating 就是我所说的“html 指令”,但我不确定它是干什么用的?
[rate] 是一个属性指令,用于设置名为“rate”的组件属性。
(rate-change) 是一个属性指令,它调用称为rateChange 的组件方法。
任何其他类型的directives?
【问题讨论】:
-
我的意思是
html directives and attribute directives之间的区别
标签: javascript html angular