2017-09-17 76 views

回答

4

@Input()不会有任何别名命名。

  • @Input() student:any[]; 
    <component [student]="..."> 
    

@Input('someValue')将别名作为someValue中

  • @Input('studentInfo') student:any[]; 
    
    <component [studentInfo]="..."> 
    

使用别名时的说明确保您在HTML模板中使用别名。

+1

谢谢你兄弟! –

+0

@JustinCastillo快乐tp帮助你 – Aravind

1

除了@Aravind的帖子,这也是@Output@ViewChild指令的情况。

相关问题