Open bobingham opened 6 years ago
My bad, One element in the array must be selected. Not quite clear on the instructions!
loadTimeline(carePlanSections: NcCarePlanDto[]) {
this.timeline = [];
let selected = false;
carePlanSections.forEach((section, key, arr) => {
if (Object.is(arr.length - 1, key)) {
selected = true; // execute last item logic
}
this.timeline.push({ caption: section.subject, date: moment(section.reviewDatetime).toDate(), title: section.subject, selected: selected, content: section.editor })
})
}
I have a problem loading data. I fire the loadTimeline method after I have received data from the server. If I build the TimelineElement array manually everything works fine. If I load by pushing new objects into the array I get the following error: