I am a newcomer to the world of angular and I am attempting to utilize the new md-table component in Angular Material 2 with Angular 4.
I have created a service that fetches simple arrays of content from an API. However, I am struggling to use this service as a data source for the md-table as I am unable to retrieve the data from the service (it always returns an empty array).
Prior to using md-table, I had successfully used the service without any issues.
Below is the code for the component :
// Component code here
...
Here is the corresponding HTML code :
// HTML code here
...
And here is the service code :
// Service code here
...
I am unsure about the correct way to call the service using the datasource. I have tried calling it in the ngOnInit method as I did previously, but it does not seem to work. Any help would be greatly appreciated.
Thank you for your assistance.