3
我还没有弄清楚这两种语法的区别是什么,谢谢Angular 4中的decorator语法@Input('someValue')和@Input()有什么区别?
我还没有弄清楚这两种语法的区别是什么,谢谢Angular 4中的decorator语法@Input('someValue')和@Input()有什么区别?
@Input()
不会有任何别名命名。
例
@Input() student:any[];
<component [student]="...">
@Input('someValue')
将别名作为someValue中
例
@Input('studentInfo') student:any[];
<component [studentInfo]="...">
使用别名时的说明确保您在HTML模板中使用别名。
除了@Aravind的帖子,这也是@Output
和@ViewChild
指令的情况。
谢谢你兄弟! –
@JustinCastillo快乐tp帮助你 – Aravind