【发布时间】:2018-02-25 21:10:34
【问题描述】:
我一直不清楚这两种语法有什么区别,提前谢谢
【问题讨论】:
标签: angular typescript decorator
我一直不清楚这两种语法有什么区别,提前谢谢
【问题讨论】:
标签: angular typescript decorator
@Input() 不会有任何别名命名。
例子
@Input() student:any[];
<component [student]="...">
@Input('someValue') 将别名作为 someValue
例子
@Input('studentInfo') student:any[];
<component [studentInfo]="...">
使用别名时的说明请确保您在 HTML 模板中使用别名。
【讨论】:
除了@Aravind 帖子之外,@Output 和 @ViewChild 指令也是如此。
【讨论】: