question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mat-table, how to use it?

See original GitHub issue

Hi,

On this page: Angular Table documentation

The documentation is still with md-table instead of mat-table.

Then, I tried to use this documentation: Angular CDK documentation

But cdk-table is not recognized too.

So I tried to adapt the code:

<mat-table #table [dataSource]="sampleDataSource">
   <ng-container matColumnDef="value">
     <mat-header-cell *matHeaderCellDef> Value </mat-header-cell>
     <mat-cell *matCellDef="let sample"> {{sample.value}} </mat-cell>
   </ng-container>
 </mat-table>

But I have an error: ERROR TypeError: headerDef is undefined

Google didnt help me to find a solution: GoogleSearch

Is there someone who succeed to use mat-table and who can share his code?

Thank you

Note: MatTableModule is already loaded

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewseguincommented, Oct 11, 2017

Thanks for reporting the syntax issue - I’ll make a note to add some better error handling to help users catch this mistake sooner

0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table | Angular Material
Begin by adding the <table mat-table> component to your template and passing in data. The simplest way to provide data to the table...
Read more >
Angular Material Data Table: A Complete Example
In this post, we are going to go through a complete example of how to use the Angular Material Data Table.
Read more >
Using Angular Material Mat Table in Angular | Sort | Pagination
angular #angularmaterial # mattable #paginator #sortIn this video, you'll learn how to use Angular Material Table mat-table in your Angular ...
Read more >
Using Angular Material Table Mat Table - Code Handbook
Display Data in Mat Table. You can use the getUsers method to fetch the data. You need to predefine the fields you want...
Read more >
Displaying Data using Angular 12 Material Tables - Section.io
In this article, we'll be looking at how to use Angular Material Tables to ... <table mat-table [dataSource]="dataSource"> <ng-container ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found