FullCalendar Scheduler - 类型 'string' 不可分配给类型 'EmitterInterface[]

FullCalendar Scheduler - Type 'string' is not assignable to type 'EmitterInterface[]

我正在尝试在 Angular 2 中实现 FullCalendar Scheduler,并且我已按照以下指定的步骤进行操作 -

安装了所需的依赖项如下 -

"dependencies": {
   "fullcalendar": "^3.8.0",
    "fullcalendar-scheduler": "^1.9.1",
    "jquery": "^3.2.1",
    "moment": "^2.20.1"
  },
  "devDependencies": {
    "@types/jquery": "^2.0.47"
  }

更新了 angular-cli.json 如下 -

"styles": [
            "styles.css",
            "../node_modules/bootstrap/dist/css/bootstrap.min.css",
            "../node_modules/fullcalendar/dist/fullcalendar.min.css",
            "../node_modules/fullcalendar-scheduler/dist/scheduler.min.css",
            "../node_modules/primeng/resources/primeng.min.css",
            "../node_modules/primeng/resources/themes/omega/theme.css",
            "../node_modules/font-awesome/css/font-awesome.min.css"
        ],
        "scripts": ["../node_modules/jquery/dist/jquery.js",
            "../node_modules/moment/min/moment.min.js",
            "../node_modules/fullcalendar/dist/fullcalendar.js",
             "../node_modules/fullcalendar-scheduler/dist/scheduler.min.js"
        ],

我已经在 main.tsmodule.ts -

中导入了依赖项

main.ts -

import * as jQuery from "jquery";
(window as any).$ = (window as any).jQuery = jQuery;

app.component.html-

<div id='calendar'></div>

app.component.ts

import { Component } from '@angular/core';
import 'fullcalendar';
import 'fullcalendar-scheduler';
declare let $: any;

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  ngOnInit() {
    $('#calendar').fullCalendar({});
  }
}

我已经解决了 jQuery 错误中指定的 @type/jquery 问题,但是我无法编译它给出的下面提到的错误代码 -

ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (347,6): Type 'string' is not assignable to type 'EmitterInterface[]'.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (124,27): ']' expected.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (125,28): ']' expected.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (125,33): ';' expected.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (126,28): ']' expected.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (126,33): ';' expected.

请找到full error here。我已经查看了以下主题和资源,但这些似乎无法解决问题 -

https://github.com/fullcalendar/fullcalendar/issues/3991

我请求你的帮助。

这应该适合你。您也可以在这里查看 git 回购 https://gitlab.com/haque.mdmanzurul/ng-fullcalendar

app.component.ts

import * as jQuery from 'jquery';
(window as any).jQuery = (window as any).$ = jQuery; // This is needed to resolve issue.
import { Component, OnInit } from '@angular/core';
import 'fullcalendar';

 @Component({
   selector: 'app-root',
   templateUrl: './app.component.html',
   styleUrls: ['./app.component.css']
 })
 export class AppComponent implements OnInit {
 title = 'My Calendar';

 ngOnInit() {
   $('#calendar').fullCalendar({});
 }
}

angular-cli.json:

"styles": [
    "styles.css",
    "../node_modules/fullcalendar/dist/fullcalendar.min.css"
  ],
  "scripts": [
    "../node_modules/fullcalendar/dist/fullcalendar.js"
  ],

package.json

{
  "name": "mycalendar",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
  "ng": "ng",
  "start": "ng serve",
  "build": "ng build",
  "test": "ng test",
  "lint": "ng lint",
  "e2e": "ng e2e"
},
"private": true,
"dependencies": {
 "@angular/animations": "^4.2.4",
 "@angular/common": "^4.2.4",
 "@angular/compiler": "^4.2.4",
 "@angular/core": "^4.2.4",
 "@angular/forms": "^4.2.4",
 "@angular/http": "^4.2.4",
 "@angular/platform-browser": "^4.2.4",
 "@angular/platform-browser-dynamic": "^4.2.4",
 "@angular/router": "^4.2.4",
 "core-js": "^2.4.1",
 "rxjs": "^5.4.2",
 "zone.js": "^0.8.14",
 "fullcalendar": "^3.4.0",
 "jquery": "^3.2.1",
 "moment": "^2.19.1"
 },
"devDependencies": {
 "@angular/cli": "1.4.9",
 "@angular/compiler-cli": "^4.2.4",
 "@angular/language-service": "^4.2.4",
 "@types/jasmine": "~2.5.53",
 "@types/jasminewd2": "~2.0.2",
 "@types/jquery": "^3.2.7",
 "@types/node": "~6.0.60",
 "codelyzer": "~3.2.0",
 "jasmine-core": "~2.6.2",
 "jasmine-spec-reporter": "~4.1.0",
 "karma": "~1.7.0",
 "karma-chrome-launcher": "~2.1.1",
 "karma-cli": "~1.0.1",
 "karma-coverage-istanbul-reporter": "^1.2.1",
 "karma-jasmine": "~1.1.0",
 "karma-jasmine-html-reporter": "^0.2.2",
 "protractor": "~5.1.2",
 "ts-node": "~3.2.0",
 "tslint": "~5.7.0",
 "typescript": "~2.3.3"
 }
}