【发布时间】:2021-05-20 13:03:43
【问题描述】:
如何将事件放入日历中?
HTML
<full-calendar #calendar [options]="calendarOptions"></full-calendar>
TS
export class AppComponent implements OnInit {
constructor(
private vacationService: VacationService,
) {}
ngOnInit(): void {
this.loadEvents();
}
// references the #calendar in the template
@ViewChild('calendar') calendarComponent: FullCalendarComponent;
calendarOptions: CalendarOptions = {
initialView: 'dayGridMonth',
headerToolbar: {
left: '',
center: 'title',
},
editable: true,
};
loadEvents(): void {
this.vacationService.getAll().subscribe((data) => {
// My data
console.log(data);
})
}
}
这是我的 Api 响应
(1) [{…}] 0: 日期:“2018-03-29T13:34:00.000+0200” holidayGR: {id: 21, holiday: "First Event"} 编号:7 原型:对象
有什么帮助吗?或工作示例?谢谢
【问题讨论】:
标签: angular fullcalendar fullcalendar-4