mariuszfoltak/angular2-datatable

datatable only works with mf.data

Closed this issue · 2 comments

Hi,

I have a question.
Why we need always pass our data with this mf.data?
If I use other kind of name for my data the data table never works.

Thanks for help me.

I do this question because I want use two data tables in same view.

I read #50 this issue and understand the problem.

We need use #nameReference="mfDataTable" and pass [mfData]="dataArray"
and then use in *ngFor="let item of nameReference.data"

<table [mfData]="firstArray" #first="mfDataTable">
  ...
  <tr *ngFor="let item of first.data">
  ..
</table>
<table [mfData]="secondArray" #second="mfDataTable">
  ...
  <tr *ngFor="let item of second.data">
  ..
</table>

Great! It works!
Thanks a lot!