// Angular.json
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/@fullcalendar/core/main.css",
"node_modules/@fullcalendar/daygrid/main.css",
"src/styles.css"
],
// app.module.ts
import { FullCalendarModule } from '@fullcalendar/angular';
...
imports: [...
FullCalendarModule]
//component.html
<full-calendar
defaultView="dayGridMonth"
[plugins]="calendarPlugins"
[weekends]="false"
[events]="[
{ title: 'event 1', date: '2019-04-01' },
{ title: 'event 2', date: '2019-04-02' }
]"
></full-calendar>
//component.ts
import { Component } from '@angular/core';
import dayGridPlugin from '@fullcalendar/daygrid';
@Component({
selector: 'app-demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.css']
})
export class DemoComponent {
calendarPlugins = [dayGridPlugin]; // important!
}
我在Angular 9应用程序中完整列出了日历使用以下命令:npm install --save @ fullcalendar / angular @ fullcalendar / core @ fullcalendar / daygrid
运行应用程序时出现此错误
目标入口点“ @ fullcalendar / angular”中的错误缺少相关性:-@ fullcalendar / core / types / input-types-@ fullcalendar / core / datelib / env-@ fullcalendar / core / datelib / duration-@ fullcalendar / core / datelib /格式-@ fullcalendar / core / datelib /日期范围-@ fullcalendar / core / datelib / locale-@ fullcalendar /核心/验证-@ fullcalendar / core / structs / event-source
** Angular Live Development Server正在localhost:4200上侦听,请在http://localhost:4200/ **上打开浏览器>
// Angular.json“ styles”:[“ node_modules / bootstrap / dist / css / bootstrap.min.css”,“ node_modules/@fullcalendar/core/main.css”,“ node_modules / @ fullcalendar / ...
好的,看来您的库在Angular 9上有一些问题: