Как загрузить селектор таблиц в Angular 2?
table.html
<table [mfData]="(data | filter:name)" #mf="mfDataTable" >
<thread>
<tr>
<th> row 1 </th>
</tr>
</thread>
<app-view> Loading... </app-view>
</table>
ComponentA.component.ts
@Component({
selector: 'app-dataSet',
templateURL: './table.html'
})
...
// this line is the table value (this.data is the mapping for mf)
this.getNameService.getName().subscribe( res => { this.data = res; });
...
body.html
<tbody>
<tr *ngFor="let item of mf?.data">
<td> {{item.name}} </td>
</tr>
</tbody>
ComponentB.component.ts
@Component({
selector: 'app-view',
templateURL: './body.html'
})
export class ComponentB {
// what do I need here in order to get mf data to load?
}
Я хочу, чтобы приложение работало, но я не могу передать данные из компонента A в компонент B