你好社区我在我的 Angular 9 应用程序中使用https://fullcalendar.io/(版本 5)的完整日历。
我已经看到日历具有这些选项来更改视图类型。
准安装
我已经安装了模块
npm install --save @fullcalendar/angular
npm install --save @fullcalendar/daygrid
npm i @fullcalendar/interaction
我已将它导入到您使用它的模块中
// calendar
import { FullCalendarModule } from '@fullcalendar/angular';
import dayGridPlugin from '@fullcalendar/daygrid';
import interactionPlugin from '@fullcalendar/interaction';
FullCalendarModule.registerPlugins([
dayGridPlugin,
interactionPlugin
]);
and I've created a component called organizer to use it, in which I have the following code
import { Component, OnInit } from '@angular/core';
import { CalendarOptions } from '@fullcalendar/angular';
@Component({
selector: 'app-skechuler',
templateUrl: './skechuler.component.html',
styles: [
]
})
export class SkechulerComponent implements OnInit {
calendarOptions: CalendarOptions = {
initialView: 'dayGridMonth',
dateClick: this.handleDateClick.bind(this), // bind is important!
events: [
{ title: 'event 1', date: '2020-06-27' },
{ title: 'event 2', date: '2020-06-30' }
]
};
handleDateClick(arg: any) {
alert('date: ' + arg.dateStr);
}
constructor() { }
ngOnInit(): void {
}
}
及其html
<full-calendar #calendar [options]="calendarOptions"></full-calendar>
but i don't understand how to activate the above mentioned function to access this view: