I am trying to simply display data from a MySQL database using Angular (5) with a Material table. The code I have compiles successfully, and a table with the column names and pa
Try to use an elvis operator ?
in the template to begin with. If it is just the template issue, that should get your problem solved.
[length]="unitTypeDatabase?.data?.length"
The reason is when the view is rendered there is no unitTypeDatabase
defined yet as it is only initialized in the ngOnInit()
. See if that fixes your issue.