JH-Sen-Ren
JH-Sen-Ren

Reputation: 279

Why are rows being displayed, but no data being shown in my material table?

I want to display some data in an Angular (version 8) Material table, using a MatTableDataSource object. The data is being set properly, following the documentation, and the rows are showing but the data inside them is not.

I've tried following the documentation to the letter, but with no luck.

I have created a StackBlitz example with some fake data which replicates the issue: https://stackblitz.com/edit/angular-xd9wyz?file=src%2Fapp%2Fapp.component.ts

Note I have also output the data contained in the datasource below the table.

I don't receive any error messages in the console, and I'm now stuck. Any insight would be very useful!

Upvotes: 0

Views: 341

Answers (1)

Piyush Jain
Piyush Jain

Reputation: 1986

please correct this line - displayedColumns: string[] = ['key', 'name', 'mod-count'];. you skipped "type" and "equal" sign.

Upvotes: 2

Related Questions