-1
我是Angular的新手,並且試圖將子組件中的數組傳遞給父組件。在子組件,我有以下幾點:如何將路由的孩子的@Output值轉換爲父組件Angular 4
export class AoRSummaryComponent implements OnInit, AfterViewInit, OnDestroy {
@Output() fooDetails: EventEmitter<any> = new EventEmitter();
...
//then the code that builds the array (this.detailsObj.aorDetails)
...
this.fooDetails.emit(this.detailsObj.aorDetails);
我的問題是,我該怎麼包括父組件的HTML,才能在語句中的* ngFor =「fooDetails的細節讓」使用fooDetails?我似乎無法使用<child-component-selector></child-component-selector>
語句,因爲我們使用<router-outlet>
加載子組件。任何幫助將非常感激。
找到你解決這個問題? –