Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Angular中初始化完整日历版本4_Angular_Typescript_Fullcalendar_Fullcalendar Scheduler_Fullcalendar 4 - Fatal编程技术网

如何在Angular中初始化完整日历版本4

如何在Angular中初始化完整日历版本4,angular,typescript,fullcalendar,fullcalendar-scheduler,fullcalendar-4,Angular,Typescript,Fullcalendar,Fullcalendar Scheduler,Fullcalendar 4,我正在尝试使用完整的日历版本4,这样我就可以在后台模式下对事件使用鼠标悬停事件。由于某些原因,我无法在我的组件(设置选项)中初始化它,我的意思是当我运行ng serve时它可以工作,但我在IDE中遇到错误。我将在这里发布图片错误和我的代码。 你可以在这里看到官方文件 我尝试使用OptionInputs作为参数,但没有成功 import { Component, OnInit } from '@angular/core'; import { DataService } from './..

我正在尝试使用完整的日历版本4,这样我就可以在后台模式下对事件使用鼠标悬停事件。由于某些原因,我无法在我的组件(设置选项)中初始化它,我的意思是当我运行ng serve时它可以工作,但我在IDE中遇到错误。我将在这里发布图片错误和我的代码。 你可以在这里看到官方文件

我尝试使用OptionInputs作为参数,但没有成功

  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();
} }


您正在错误的结构中写入options对象,它需要plugin属性

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

错误在您的屏幕截图中。您没有将
插件
参数。。。查看
OptionInputs
以查看正确的选项结构。@distante我已经看到了,但无法找出错误所在。导出接口选项输入扩展选项输入库{buttonText?:ButtonTextCompoundInput;视图?:{[viewId:string]:ViewOptionInput;};插件:PluginDef[];}您能把错误放在一起吗?@distante