My Angular code is written in the component.ts file. I am fetching data from a backend API and using console.log
to display the data.
getInfo() {
const params = [];
params.push({code: 'Code', name: 'ty_PSD'});
params.push({code: 'continentCodes', name: ['CAN']});
params.push({code: 'dateFrom', name: '2019-01-01'});
params.push({code: 'dateTo', name: '2019-12-31'});
params.push({code: 'statusType', name: 'REAL'});
params.push({code: 'valueType', name: 'TTV'});
this.serviceHandler.getDemand([], params).subscribe(
demand => {
console.log(demand + 'ddd');
});
}
The output of console.log(demand)
can be seen at https://i.stack.imgur.com/ScYxg.png. The API response is displayed as shown in https://i.stack.imgur.com/n63TN.png.
I'm trying to extract values into an array from the data: Array(365)
. How can I achieve this?