0

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.

knight8989
  • 11
  • 2

1 Answers1

0

//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.

https://angular.io/guide/http

http://prntscr.com/pvz2f1

Rise
  • 1,493
  • 9
  • 17
  • 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. – knight8989 Nov 12 '19 at 17:22