How to use Fullcalendar in Angular 13?

By Hardik Savani November 5, 2023 Category : Angular


Now, let's see post of angular 13 fullcalendar example. I would like to show you fullcalendar angular 13 example. I would like to share with you how to add event dynamically in fullcalendar angular 13. This post will give you simple example of how to create a full calendar in angular 13. follow bellow step for how to implement full calendar in angular 13.

In this example, we will use @fullcalendar/angular npm package to fullcalendar. Then we will create events api using php and call in angular app and display events. you can follow below step to implement full calendar in angular app.


Step 1: Create New App

You can easily create your angular app using bellow command:

ng new myNewApp

Step 2: Install fullcalendar npm Package

Now in this step, we need to just install @fullcalendar/angular, @fullcalendar/daygrid and @fullcalendar/interaction in our angular application. so let's add as like bellow:

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

npm install --save @fullcalendar/interaction

Step 3: Import FullCalendarModule

we will import FullCalendarModule module as like bellow code:


import { NgModule } from '@angular/core';

import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';

import { HttpClientModule } from '@angular/common/http';

import { FullCalendarModule } from '@fullcalendar/angular';

import dayGridPlugin from '@fullcalendar/daygrid';

import interactionPlugin from '@fullcalendar/interaction';






declarations: [



imports: [





providers: [],

bootstrap: [AppComponent]


export class AppModule { }

Step 4: Update Ts File

here, we need to update ts file as like bellow:


import { Component } from '@angular/core';

import { HttpClient } from '@angular/common/http';

import { CalendarOptions } from '@fullcalendar/angular';


selector: 'app-root',

templateUrl: './app.component.html',

styleUrls: ['./app.component.css']


export class AppComponent {

title = 'fullcal';

Events: any[] = [];



Define calendarOptions



calendarOptions: CalendarOptions = {

initialView: 'dayGridMonth',

dateClick: this.handleDateClick.bind(this)




Define constructor



constructor(private httpClient: HttpClient) {}



Define ngOnInit()



ngOnInit() {



.subscribe((res: any) => {

this.Events = res; = this.Events;





Define handleDateClick()



handleDateClick(arg: any) {

alert('date click! ' + arg.dateStr)



Step 5: Update HTML File

here, we need to update html file as like bellow code:


<div class="container">

<h1>Angular 13 Fullcalendar Example - </h1>

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


Step 6: Create API

Here, we will create simple php file call events.php and return two events as json. so let's create file and run php app.



header("Access-Control-Allow-Origin: *");

header("Access-Control-Allow-Methods: PUT, GET, POST");

header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");

$calendarEvents = [

['title' => 'Hardik Event', 'date' => '2022-04-01'],

['title' => 'HD Event', 'date' => '2022-04-02'],


echo json_encode($calendarEvents);

Now, you have to run this file using bellow command:

php -S localhost:8001

Run Angular App:

All the required steps have been done, now you have to type the given below command and hit enter to run the Angular app:

ng serve

Now, Go to your web browser, type the given URL and view the app output:


now you can check it.


I hope it can help you...