0👍
✅
remove the "list" and replace areaCode with area
ngOnInit(): void {
this.chartService.noOfEqu().subscribe(res=>{
console.log(res);
let areaCode = res.map(res=>res.area)
let inoperEqu = res.map(res=>res.inoperEqu)
let operEqu = res.map(res=>res.operEqu)
let date = res.map(res=>res.eventDate)
let Dates = []
date.forEach((res) => {
let jsdate = new Date(res *1000)
Dates.push(jsdate.toLocaleTimeString('en', {year: 'numeric', month: 'short', day:'numeric' }))
});
console.log(Dates)
console.log(areaCode)
})
}
}
Source:stackexchange.com