简体   繁体   English

Angular 9:找不到命名空间“FullCalendarVDom”?

[英]Angular 9: Cannot find namespace 'FullCalendarVDom'?

I installed rrule plugin by running:我通过运行安装了rrule插件:

npm install @fullcalendar/rrule

but when I add its import to my component:但是当我将其导入添加到我的组件时:

import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';
import interactionPlugin from '@fullcalendar/interaction';
import rrulePlugin from '@fullcalendar/rrule';  //error appears after adding this import

I get this errors:我得到这个错误:

    node_modules/@fullcalendar/common/vdom.d.ts:16:28 - error TS2304: Cannot find name 'FullCalendarVDom'.
    
    16 export import flushToDom = FullCalendarVDom.flushToDom;
                                  ~~~~~~~~~~~~~~~~
    node_modules/@fullcalendar/common/vdom.d.ts:16:28 - error TS2503: Cannot find namespace 'FullCalendarVDom'.
    
    16 export import flushToDom = FullCalendarVDom.flushToDom;

Other plugin imports are working fine.其他插件导入工作正常。 Where is the problem?问题出在哪里?

In case it's useful for anyone, here's what worked for me.如果它对任何人有用,这对我有用。

(Edit: I'm obviously using PrimeNG with Angular...) (编辑:我显然将 PrimeNG 与 Angular 一起使用......)

In the xyz.component.html file:xyz.component.html文件中:

<p-fullCalendar #calendar ...></p-fullCalendar>

In the xyz.component.ts file:xyz.component.ts文件中:

import {FullCalendar} from 'primeng/fullcalendar';

...

@ViewChild('calendar') private calendar: FullCalendar;

Didn't need to use the calendar field for anything, but this hack seems to get the imports in the right order.不需要使用calendar字段做任何事情,但这个黑客似乎以正确的顺序获取导入。 For some reason.由于某些原因。 Go figure. Go 图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM