Angular 12FullCalendar

Angular 12 FullCalendar Working Demo

Angular 12 FullCalendar Working Demo

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

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

Angular Full Calendar
Angular 12 FullCalendar Working Demo
Angular 12 FullCalendar Working Demo

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

  1. Angular 12 Tutorials

Here is the code snippet and please use carefully:

1. Very first guys, here are common basics steps to add angular 12 application on your machine and also we must have latest nodejs version(14.17.0) installed for angular 12:

$ npm install -g @angular/cli

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

cd angularfullcalendar // Go inside project folder

2. Now run below commands to set fullcalendar modules into our angular 12 application:

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

3. Now we will add below code into our angularfullcalendar/src/app/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 we will add below code into our angularfullcalendar/src/app/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 we will add below code into our angularfullcalendar/src/app/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

Ajay Malhotra
the authorAjay Malhotra
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, Angular 8, Angular 9, Angular 10, Angular 11, Angular12, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

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