Home Angular 11 Angular 11 FullCalendar Working Demo

Angular 11 FullCalendar Working Demo

by therichpost
Published: Updated: 10 comments
Angular 11 FullCalendar Working Demo

Hello to all, welcome to therichpost.com. In this post, I will tell you, Angular 11 FullCalendar Working Demo.

The main purpose of making this post is fullcalendar has been updated to version 5.

Angular Full Calendar

Angular11 came and if you are new then you must check below two links:

  1. Angular 11 Tutorials

Here is the code snippets for Angular 11 FullCalendar Working Demo and please use carefully:

1. Very first, here are common basics steps to add angular 11 application on your machine:

$ npm install -g @angular/cli

$ ng new angularfullcalendar // Set Angular 11 Application on your pc

cd angularfullcalendar // Go inside project folder
ng serve // Run project http://localhost:4200/ //Check working Local server

 

2. Now run below commands to set fullcalendar modules into your angular 11 application:

npm install --save @fullcalendar/angular @fullcalendar/daygrid
npm i @fullcalendar/interaction

 

3. Now add below code into your app.module.ts file:

...
import { FullCalendarModule } from '@fullcalendar/angular'; 
import dayGridPlugin from '@fullcalendar/daygrid'; 
import interactionPlugin from '@fullcalendar/interaction'; 
FullCalendarModule.registerPlugins([ 
  dayGridPlugin,
  interactionPlugin
]);
...
  imports: [
    ...
  FullCalendarModule 
  ],
 ...

 

4. Now add below code into your app.component.ts file:

...
import { CalendarOptions } from '@fullcalendar/angular'; // useful for typechecking
export class AppComponent {
  ...
  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) {
    alert('date click! ' + arg.dateStr)
  }
}

 

5. Finally add below code into your app.component.html file:

<full-calendar [options]="calendarOptions"></full-calendar>

 

Now we are done friends and please run ng serve command and if you have any kind of query then please do comment below.

Note: Friends, I just tell the basic setup and things, you can change the code according to your requirements. For better understanding must watch video above.

I will appreciate that if you will tell your views for this post. Nothing matters if your views will be good or bad.

Jassa

Thanks

You may also like

10 comments

amrane December 6, 2020 - 4:28 am

when i install these commandes that what i get
npm WARN @fullcalendar/angular@5.4.0 requires a peer of @angular/common@9 – 10 but none is installed. You must install peer dependencies yourself.
npm WARN @fullcalendar/angular@5.4.0 requires a peer of @angular/core@9 – 10 but none is installed. You must install peer dependencies yourself.

and when i finished to implement the calendar i got this error :
Error: node_modules/@fullcalendar/angular/lib/fullcalendar.module.d.ts:2:22 – error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (@fullcalendar/angular) which declares FullCalendarModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library’s authors to see if the library is expected to be compatible with Ivy.

2 export declare class FullCalendarModule {
~~~~~~~~~~~~~~~~~~
can you help please

Reply
Ajay Malhotra December 6, 2020 - 4:30 am

Strange and I will check and let you know.

Reply
Sam November 28, 2024 - 6:44 am

same error occur in angular 11 version.

Reply
Luis José Sánchez April 11, 2021 - 11:49 am

Thank you Ajay! It worked for me.

Reply
Ajay Malhotra April 12, 2021 - 4:11 am

That is great.

Reply
Laynt May 12, 2021 - 5:47 pm

Thank you Ajay, you helped me so much

Reply
Ajay Malhotra May 13, 2021 - 4:04 am

You are welcome.

Reply
Ajay Malhotra May 20, 2021 - 10:06 am

Please check the updated version for Angular 12:
https://therichpost.com/angular-12-fullcalendar-working-demo/

Reply
varsha May 19, 2021 - 12:34 pm

Hi i am getting error when we import fullCanlenderModule in app.module.ts file

Reply
Ajay Malhotra May 20, 2021 - 10:06 am

Please check the updated version for Angular 12:
https://therichpost.com/angular-12-fullcalendar-working-demo/

Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.