How to format json data to array format and nested arrays are in object like {} without square brackets in typscript.
Now return data as :
{
"ProductID": 1,
"Category": [{
"CategoryID": 1,
"SubCategory": [{
"SubCategoryID": 1,
}]
}]
}
I want converted output data as in typescript:
[{
"ProductID": 1,
"Category": {
"CategoryID": 1,
"SubCategory": {
"SubCategoryID": 1,
}
}
}]
I have tried
return this.restApi.getProductBin().subscribe((data: {}) => {
const usersJson: any[] = Array.of(data);
})