如何使用Angular在FullCalendar中设置可点击日期?

如何使用Angular在FullCalendar中设置可点击日期?,angular,fullcalendar,Angular,Fullcalendar,我开始使用FullCalendar,但我被卡住了。我不能使这个按钮可点击 工作日期或我没有正确理解。除了在我的fullcalendar组件中设置[navLinks]=“true”,我还需要执行其他操作吗?如果是,我该怎么办 我的代码: <full-calendar defaultView="dayGridMonth" [plugins]="calendarPlugins" [aspectRatio]="2.2"

我开始使用FullCalendar,但我被卡住了。我不能使这个按钮可点击 工作日期或我没有正确理解。除了在我的
fullcalendar
组件中设置
[navLinks]=“true”
,我还需要执行其他操作吗?如果是,我该怎么办

我的代码:

<full-calendar defaultView="dayGridMonth" 
              [plugins]="calendarPlugins"
              [aspectRatio]="2.2"
              [navLinks]="true"
              [header]="{ left: 'prevYear,prev,next,nextYear today',
                          center: 'title',
                          right: ' dayGridMonth,timeGridWeek,timeGridDay'}">
</full-calendar>

我想你的解决方案还需要两件事

(dateClick)="handleDateClick($event)"

[events]="calendarEvents"
在您的组件中

calendarEvents: EventInput[] = [
    { title: 'Event Now', start: new Date() }
];

handleDateClick(arg) {
    if (confirm('Would you like to add an event to ' + arg.dateStr + ' ?')) {
      this.calendarEvents = this.calendarEvents.concat({ // add new event data. must create new array
        title: 'New Event',
        start: arg.date,
        allDay: arg.allDay
      })
    }
  }

您的(日期点击)在哪里?=“handleDateClick($event)”。如果这没有帮助,请创建StackBlitz。在Angular插件中使用导航链接似乎会导致脚本错误:
无法读取未定义的属性“emit”
-演示:。但它在常规日历中运行良好。我建议向维护人员提出一个bug。请参阅说明是的,我曾想过执行这些步骤,但我在他们的文档
中读到了这一点,如果为true,则可以单击日标题和周数。单击这些链接时,用户将看到一个代表日/周的视图。
我认为@prabhatojha不需要函数