I am trying to populate a mat-table with data received from backend in json format. Since there is key associated with each value, I want to use that as column header instead of using a model. I went through the official doc which has only support for static column values. Anyone has any docs or github repos dealing with this issue. I came across one question in stack overflow itself Angular Material Table Dynamic Columns without model.
But I have issue with understanding what happens under the comment //GET SOMETHING FROM SERVICE. Any help would be much appreciated, thank you.
Add a comment
|
1 Answer
//GET SOMETHING FROM SERVICE
this.listecidenKisi = this.listeciServis.listecidenKisi;
this.listecidenVazife = this.listeciServis.listecidenVazife;
These are both service function that calls back end APIs.
So this.listecidenKisi and this.listecidenVazife are array data from back end.
Please refer following for Angular Http Client.
1 Comment
knight8989
So if i convert the js object from backend to key-value pairs, will I be able to substitute the service call with that data and finally use it in a material table? i dont have ssms installed in my local system to try it right now.