I am new in angular 5 development. I am trying to develop a data table with angular material using the example provided here: "https://material.angular.io/components/table/examples".
I am getting an error saying Can't bind to 'dataSource' since it isn't a known property of 'table'.
Please help.
Material example is using the wrong table tags. Change
to
For Angular 7
Check where is your table component located. In my case it was located like app/shared/tablecomponent where shared folder contains all sub components But I was importing material module in Ngmodules of app.module.ts which was incorrect. In this case Material module should be imported in Ngmodules of shared.module.ts And it works.
There is NO NEED to change 'table' to 'mat-table' in angular 7.
Angular7 - Can't bind to 'dataSource' since it isn't a known property of 'mat-table'