irossimoline / angular4-material-table

Angular 4 table based on @angular/cdk table structure, to allow row insertion, edition, validation and deletion.
MIT License
55 stars 24 forks source link

How to get the current data in TableDataSource? #24

Open CindyLulu opened 6 years ago

CindyLulu commented 6 years ago

Currently there's no public attribute for us to get the current data in TableDataSource instance, right? I check the source code of TableDataSource, it seems the data is stored in rowsSubject, could we change the rowsSubject to a public attribute? so that we can deal the logic with data rows in typescript files.

irossimoline commented 6 years ago

Hi @cindylulu,

You can access datasourceSubject, which is an array with the data in the table. Currently the is no outer access to rowsSubject, because that doesn't have to be displayed to outer classes, and it's private for abstraction purposes.