fullcalendar'' 没有导出成员 'Options'。- 在 Angular 中出现错误

fullcalendar'' has no exported member 'Options'.- getting error in Angular

我正在按照这个 ApNg2Fullcalendar 逐步安装结构,我使用 Angular 5,

但我有以下错误

node_modules/ap-angular2-fullcalendar/src/calendar/calendar.d.ts(3,10): error TS2305: Module ''fullcalendar'' has no exported member 'Options'. node_modules/fullcalendar/dist/fullcalendar.d.ts(695,36): error TS2304: Cannot find name 'JQueryPromise'. node_modules/fullcalendar/dist/fullcalendar.d.ts(696,29): error TS2304: Cannot find name 'JQueryPromise'. node_modules/fullcalendar/dist/fullcalendar.d.ts(697,20): error TS2304: Cannot find name 'JQueryPromise'. node_modules/fullcalendar/dist/fullcalendar.d.ts(759,22): error TS2304: Cannot find name 'JQueryPromise'. node_modules/fullcalendar/dist/fullcalendar.d.ts(775,50): error TS2304: Cannot find name 'JQueryPromise'. node_modules/fullcalendar/dist/fullcalendar.d.ts(988,23): error TS2304: Cannot find name 'JQueryEventObject'. node_modules/fullcalendar/dist/fullcalendar.d.ts(1401,70): error TS2304: Cannot find name 'JQueryAjaxSettings'. node_modules/fullcalendar/dist/fullcalendar.d.ts(1603,50): error TS2304: Cannot find name 'JQueryPromise'. node_modules/fullcalendar/dist/fullcalendar.d.ts(1623,50): error TS2304: Cannot find name 'JQueryPromise'. node_modules/fullcalendar/dist/fullcalendar.d.ts(2588,50): error TS2304: Cannot find name 'JQueryPromise'.

如何解决? 我的 index.component.ts

import { Component,  } from '@angular/core';
import 'Fullcalendar';



@Component({
  selector: 'app-index',
  templateUrl: './index.component.html',
  styleUrls: ['./index.component.css']
})
export class IndexComponent  {
  title = 'app';

  calendarOptions:Object = {
    height: 'parent',
    fixedWeekCount : false,
    defaultDate: '2016-09-12',
    editable: true,
    eventLimit: true, // allow "more" link when too many events
    events: [
      {
        title: 'All Day Event',
        start: '2016-09-01'
      },
      {
        title: 'Long Event',
        start: '2016-09-07',
        end: '2016-09-10'
      },
      {
        id: 999,
        title: 'Repeating Event',
        start: '2016-09-09T16:00:00'
      },
      {
        id: 999,
        title: 'Repeating Event',
        start: '2016-09-16T16:00:00'
      },
      {
        title: 'Conference',
        start: '2016-09-11',
        end: '2016-09-13'
      },
      {
        title: 'Meeting',
        start: '2016-09-12T10:30:00',
        end: '2016-09-12T12:30:00'
      },
      {
        title: 'Lunch',
        start: '2016-09-12T12:00:00'
      },
      {
        title: 'Meeting',
        start: '2016-09-12T14:30:00'
      },
      {
        title: 'Happy Hour',
        start: '2016-09-12T17:30:00'
      },
      {
        title: 'Dinner',
        start: '2016-09-12T20:00:00'
      },
      {
        title: 'Birthday Party',
        start: '2016-09-13T07:00:00'
      },
      {
        title: 'Click for Google',
        url: 'http://google.com/',
        start: '2016-09-28'
      }
    ]
  };

  onCalendarInit(initialized: boolean) {
    console.log('Calendar initialized');
  }

}

app.module.ts

import { CalendarComponent } from 'ap-angular2-fullcalendar';
import { CalendarModule } from 'ap-angular2-fullcalendar';

@NgModule({
  declarations: [
    AppComponent,

    IndexComponent,

    CalendarComponent

  ],
  imports: [
    BrowserModule,
    NgbModule.forRoot(),
    AngularFontAwesomeModule,

    routes


  ],

index.component.html

<angular2-fullcalendar [options]="calendarOptions" (initialized)="onCalendarInit($event)"></angular2-fullcalendar>

问题出在 ap-angular2-fullcalendar 中的 fullcalendar 包中 node_modules。 全日历已更新 3.8.0 但您需要 3.7.0... 我的解决方案是...

第 1 步:npm install fullcalendar@3.7.0 --save

第 2 步:在您的 package.json write/edit 'postinstall' 到“rm -Rf ./node_modules/app-angular2-fullcalendar/node_modules

我找到了一些解决方案,现在对我有用我已更新到 npm install fullcalendar@3.6.1

只需这样做 - 您可能正在使用 Angular CLI:

npm i @types/fullcalendar -s

您没有打字

我也遇到了同样的问题。我解决了将 fullcalendar dependecie 完全更新到版本 3.6.1 的问题。

npm install --save fullcalendar@3.6.1

安装后 npm install fullcalendar@3.7.0 --save我遇到问题

Module ''fullcalendar'' has no exported member 'Options' 在 angular 8.

问题出在 fullcalendar 包版本中。按照以下命令安装具有适当版本控制的 fullcalendar。工作正常。

第一步:npm install ng-fullcalendar --save; // 版本 ^2.0.3

第二步:npm install @fullcalendar/core@4.0.1 --save;

第三步:npm install @fullcalendar/daygrid@4.0.1 --save;

第四步:npm install @fullcalendar/interaction@4.0.1 --save;