Angular 9 , table examples not working


Topic: Angular 9 , table examples not working

MatAlvarez pro asked 4 months ago

*Expected behavior*I copied the code from the example page : https://mdbootstrap.com/docs/angular/tables/datatables/ and the table should render without error

*Actual behavior*Table is not loading because error logs says that at this point in code: this.mdbTable.setDataSource(this.elements); the this.mdbTable is undefined, i am using the viewchild correctly like the example

Resources (screenshots, code snippets etc.)enter image description here

enter image description here

enter image description here

enter image description here


Arkadiusz Idzikowski staff commented 4 months ago

We tried to reproduce this problem on our end but without success. Please try to move the code from OnInit hook to the AfterViewInit. In case of any further problems please prepare a simple demo with this example and send it to a.idzikowski@mdbootstrap.com so we can reproduce this problem on our end with the same configuration.


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: Angular
  • MDB Version: 9.1.0
  • Device: Laptop
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes