0

I am using the FullCalendar object and defining its options in NgOnInit.

ngOnInit() {
forwardRef(() => Calendar);


  this.calendarOptions = {
    plugins: [dayGridPlugin, interactionPlugin],
    editable: true,
    droppable: true,
    drop: function(e) {
      let calendarApi = this.fullcalendar.getApi();
      let eventList  = calendarApi.getEvents();
      console.log(eventList);
    },
    customButtons: {
      myCustomButton: {
        text: 'custom!',
        click: function () {
          alert('clicked the custom button!');
        }
      }
    },
    headerToolbar: {
      left: 'prev,next today',
      center: 'title',
      right: 'dayGridMonth'
    },
    dateClick: this.handleDateClick.bind(this),
    eventClick: this.handleEventClick.bind(this),
    eventDragStop: this.handleEventDragStop.bind(this),
    locale:'tr',
    locales:[trLocale],
    events:this.menuEvents
  };


}

The getApi() function in options returns undefined. A method that normally works in the functions I define. This doesn't just apply to getApi() . A function like MyFunction() that I have defined also returns undefined. How can I run my custom functions for the drop event in Options? Thank you for your help

atalay
  • 75
  • 1
  • 1
  • 4

0 Answers0