Angular 4中的decorator语法@Input(';someValue';)和@Input()之间有什么区别?
我还不清楚这两种语法之间的区别是什么,请提前感谢Angular 4中的decorator语法@Input(';someValue';)和@Input()之间有什么区别?,angular,typescript,decorator,Angular,Typescript,Decorator,我还不清楚这两种语法之间的区别是什么,请提前感谢@Input()将不会有任何别名命名 范例 @Input() student:any[]; <component [student]="..."> @Input('studentInfo') student:any[]; <component [studentInfo]="..."> 说明使用别名时,请确保在HTML模板中使用别名。除了@Aravind post之外,@Output和@ViewChild指令也
@Input()
将不会有任何别名命名
- 范例
@Input() student:any[]; <component [student]="...">
@Input('studentInfo') student:any[]; <component [studentInfo]="...">
说明使用别名时,请确保在HTML模板中使用别名。除了@Aravind post之外,
@Output
和@ViewChild
指令也是如此。@JustinCastillo>帮助您