After receiving data from the API, I am using the subscribe method to execute lines of code. Below is the code snippet:
this.attRecService.getAgendaData(moment(this.viewDate).format('YYYY-MM')).subscribe(
resp => {
this.agendaData = resp;
for (let item of resp) {
if (item.schedule) {
for (let sched of item.schedule) {
this.events.push({
'start': new Date(moment(item.date).format('YYYY-MM-DD')),
'title': sched.title
});
}
}
}
},
() => {
console.log('display');
this.displayClockDetail();
}
);
However, when attempting to log the word display, it appears that the code does not reach that part. What could be causing this issue?