我在angular5订阅方法中使用fullCalendar。当我对数据进行一些更改时,它应该反映在日历上,但它不起作用。我正在尝试this.ucCalendar.fullCalendar('refetchEvents')
,但是它不起作用,日历也没有刷新。我也尝试过this.ucCalendar.fullCalendar('destroy')
,它破坏了日历,但是this.ucCalendar.fullCalendar('render')
也无法正常工作。
this.calendarOptions = {
editable: true,
eventLimit: 3,
displayEventTime: false,
header: {
left: 'prev,next',
center: '',
right: 'title'
},
events: calendarEvents
};
this.ucCalendar.fullCalendar('refetchEvents')
我收到此错误。
TypeError: Cannot read property 'fullCalendar' of undefined
at SafeSubscriber.eval [as _next] (dashboard.component.ts:230)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:195)
at SafeSubscriber.next (Subscriber.js:133)
at Subscriber._next (Subscriber.js:77)
at Subscriber.next (Subscriber.js:54)
at MapSubscriber._next (map.js:41)
at MapSubscriber.Subscriber.next (Subscriber.js:54)
at eval (angularfire2.js:36)
at ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:4749)
“ fullcalendar”:“ ^ 3.6.1”, “ ng-fullcalendar”:“ ^ 1.6.1”,