2017-09-17 79 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指令的情況。

相關問題