talhature
talhature

Reputation: 2165

How do we subscribe to the currently shown data in Angular Material Tables

I need to know when the currently shown data inside material table changes and I need to subscribe to that change. If paginator is present, I need to get only the current page data.

How do we do that?

Upvotes: 2

Views: 1028

Answers (1)

talhature
talhature

Reputation: 2165

You can subscribe to datasource.connect() in order to get currently shown data changes. It only provides currently rendered data.

this.dataSource.connect().subscribe(d => console.log(d));

Upvotes: 4

Related Questions