Fullcalendar获取错误无法读取未定义的属性“源”

时间:2019-01-13 17:53:34

标签: angular5 fullcalendar

enter image description here

获取此错误。 我想根据从事件方法获得的日期来加载事件。 这是我的代码。加载时未加载,但如果我更改月份并返回到当前月份,则会加载

 this.calendarOptions = {
      editable: true,
      eventLimit: true,
      //  defaultView: 'agendaWeek',
      displayEventTime: false,
      header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
      },


      events: (start, end, timezone, callback) => setTimeout(() => { this.eventsGet(start, end, timezone, callback) }, 1000),
      eventMouseover: (event, jsEvent, view) => this.eventMouseOver(event, jsEvent, view),
    };
    
    
    
    eventsGet(start, end, timezone, callback) {
    var data = {
      "start": this.ConvertDatetoString(start._d),
      "end": this.ConvertDatetoString(end._d),
    }

    var eventstest = [];

    this.schedulerService.getEvents(data).then(data => {

      this.events = [];
      if(data)
      {
        eventstest = data;
      callback(eventstest)
      }
    });
  }
 <ng-fullcalendar #ucCalendar [(eventsModel)]="events" [options]="calendarOptions" 
          (eventDrop)="updateEvent($event.detail)" (dayClick)="dayClick($event.detail, Appointment)" (longPressDelay)="longPressDelay($event.detail)"
          (eventResize)="updateEvent($event.detail)" (clickButton)="clickButton($event.detail)"></ng-fullcalendar>

0 个答案:

没有答案