0

I'm trying to use the Full Calendar version 4 so I can use mouse over events on events in background mode. For some reason I cannot initialize it in my component(set options), I mean its working when I run ng serve, but I get error on my IDE. I will post the picture error here along with my code. Official docs you can see here https://fullcalendar.io/docs/v4/release-notes

I tried using OptionInputs as a parameter but that didn't work

  import { Component, OnInit } from '@angular/core';
  import { DataService } from './../../shared/services/data.service';
  import 'fullcalendar';
  import { Calendar } from 'fullcalendar';

  @Component({
  selector: 'app-calendar',
  templateUrl: './calendar.component.html',
  styleUrls: ['./calendar.component.css']
  })
 export class CalendarComponent implements OnInit {
 constructor(private dataService: DataService) {}

 myEvents = [];

 transformDate(str: String) {
   return str.substr(0, 10);
 }
  ngOnInit() {
const calendarEl = document.getElementById('calendar');

const calendar = new Calendar(calendarEl, {
  events: [
    {
      title: 'Test A',
      start: '2018-10-09T16:00:00'
    }
  ]
});

calendar.render();

} }

enter image description here

4

1 回答 1

1

您正在以错误的结构编写选项对象,它需要一个插件属性

const calendar = new Calendar(calendarEl, {
  events: [
    {
      title: 'Test A',
      start: '2018-10-09T16:00:00'
    }
  ],
   plugins: []
});

堆栈闪电战

于 2019-02-05T15:00:01.247 回答