I am trying to display the data returned by REST api in json format using angular but nothing loads on screen. Any idea how to achieve that?
Below is what I am trying to do -
getData() {
this.service.getData().subscribe((res) => {
this.result = res;
this.pivotReport =
{
"dataSource": {
"dataSourceType":"json",
"data":this.result
},
"slice": {
"rows": [
{
"uniqueName":"Country",
"sort":"asc"
},
{
"uniqueName":"Business Type",
"sort":"asc"
},
{
"uniqueName":"Category"
}
],
"columns": [
// {
// "uniqueName":"Category",
// "sort":"asc"
// },
// {
// "uniqueName":"Country",
// "sort":"asc"
// }
]
}
});
}