---
title: Angular Component
title_for_landing: Angular
---

<script>
import { variables } from '../../src/lib/utils/variable-injection.js';

const {site} = variables
</script>

FullCalendar seamlessly integrates with the [Angular] 16 - 21. It provides a component that exactly matches the functionality of FullCalendar's standard API.

This component is built and maintained by [irustm](https://github.com/irustm) in partnership with the maintainers of FullCalendar. It is the official Angular connector, released under an MIT license, the same license the standard version of FullCalendar uses. Useful links:

- [Browse the Github repo]({site.fullcalendar_angular_repo}) (please star it!)
- [Bug report instructions](/reporting-bugs)
- Example projects:
  [Angular 21]({site.fullcalendar_examples_tree}/angular21)
  | [20]({site.fullcalendar_examples_tree}/angular20)
  | [19]({site.fullcalendar_examples_tree}/angular19)
  | [18]({site.fullcalendar_examples_tree}/angular18)
  | [17]({site.fullcalendar_examples_tree}/angular17)
  | [16]({site.fullcalendar_examples_tree}/angular16)

This guide does not go into depth about initializing an Angular project. Please consult the aforementioned example/runnable projects for that.

The first step is to install the FullCalendar-related dependencies. You'll need FullCalendar core, the Angular adapter, and any plugins you plan to use:

```bash
npm install --save @fullcalendar/angular fullcalendar temporal-polyfill
```

Some notes:

- The `temporal-polyfill` package is small and tree-shakable, and can be used as a global polyfill if you explicitly opt-in ([more info](temporal-polyfill)).
- The `fullcalendar` package will never be imported directly when using Angular. Always use `@fullcalendar/angular`.

Next, choose one of the standard themes from [themes.fullcalendar.io](https://themes.fullcalendar.io), along with a [color palette](color-palettes). The examples below show a simplified way of importing the color palette (ex: `purple.css`), but please be aware, there are better ways to integrated with [dark mode](color-palettes#dark-mode).

In one of your app's component files ([app.component.ts]), prepare an object of options along with any plugins:

```js
import { Component } from "@angular/core";
import { CommonModule } from "@angular/common";
import { RouterOutlet } from "@angular/router";
import { FullCalendarModule, CalendarOptions } from "@fullcalendar/angular";
import themePlugin from "@fullcalendar/angular/themes/monarch"; // YOUR THEME
import dayGridPlugin from "@fullcalendar/angular/daygrid";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [CommonModule, RouterOutlet, FullCalendarModule],
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"],
})
export class AppComponent {
  calendarOptions: CalendarOptions = {
    initialView: "dayGridMonth",
    plugins: [themePlugin, dayGridPlugin],
  };
}
```

Then, add the following stylesheets to your `angular.json`:

```diff
  {
    "projects": {        // ...
      "my-project": {    // ...
        "architect": {   // ...
          "build": {     // ...
            "options": { // ...
              "styles": [
+               "@fullcalendar/angular/skeleton.css", // ALWAYS NEED SKELETON
+               "@fullcalendar/angular/themes/monarch/theme.css", // YOUR THEME
+               "@fullcalendar/angular/themes/monarch/palettes/purple.css", // YOUR THEME'S PALETTE
                "src/styles.css"
              ]
```

Then, in your component's template file ([app.component.html]), you have access to the `<full-calendar>` tag. You must pass your options into this declaration!

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

## Inputs and Emitted Events

Angular has the concept of bound input data (written with `[brackets]`) versus outputs (written with `(parentheses)`). For the FullCalendar connector, there is no distinction between inputs and outputs. Everything is passed into the master `options` input as key-value pairs. Here is an example that demonstrates passing in an `events` array and a `dateClick` handler:

```js
import { Component } from "@angular/core";
import { CalendarOptions } from "@fullcalendar/angular";
// ...

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"],
})
export class AppComponent {
  calendarOptions: CalendarOptions = {
    initialView: "dayGridMonth",
    plugins: [ /* ... */ ],
    dateClick: (arg) => this.handleDateClick(arg),
    events: [
      { title: "event 1", date: "2019-04-01" },
      { title: "event 2", date: "2019-04-02" },
    ],
  };

  handleDateClick(arg) {
    alert("date click! " + arg.dateStr);
  }
}
```

Template:

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

<h2 id='individual-inputs'>Inputs for <code>events</code>/<code>eventSources</code>/<code>resources</code></h2>

Certain options are exposed as top-level component inputs for convenience. This works well with the [`async`](https://angular.io/api/common/AsyncPipe) template helper, which accepts an `Observable` or `Promise`. The above example rewritten:

```js
import { Component } from "@angular/core";
import { CalendarOptions, EventInput } from "@fullcalendar/angular";
// ...

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"],
})
export class AppComponent {
  calendarOptions: CalendarOptions = {
    initialView: "dayGridMonth",
    plugins: [ /* ... */ ],
    dateClick: (arg) => this.handleDateClick(arg),
  };
  eventsPromise: Promise<EventInput[]>;

  handleDateClick(arg) {
    alert("date click! " + arg.dateStr);
  }
}
```

Template:

```
<full-calendar
  [options]="calendarOptions"
  [events]="eventsPromise | async"
></full-calendar>
```

This technique is commonly used when working with [NgRx](https://ngrx.io/).

### Modifying Properties

You can modify FullCalendar's options dynamically by reassigning them within the options object. This example toggles the `weekends` option on and off:

```js
import { Component } from "@angular/core";
import { CalendarOptions } from "@fullcalendar/angular";
// ...

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"],
})
export class AppComponent {
  calendarOptions: CalendarOptions = {
    initialView: "dayGridMonth",
    plugins: [ /* ... */ ],
    weekends: false, // initial value
  };

  toggleWeekends() {
    this.calendarOptions.weekends = !this.calendarOptions.weekends; // toggle the boolean!
  }
}
```

and the template:

```
<button (click)="toggleWeekends()">toggle weekends</button>
<full-calendar [options]="calendarOptions"></full-calendar>
```

If you want to modify options that are complex objects, like [headerToolbar](headerToolbar) or [events](events-array), you'll need to make a copy of the object, make your change, and then reassign it. If you DO NOT want to do this, you can have the angular connector recursively search for changes within your objects, though this comes at a slight performance cost. Set the `deepChangeDetection` prop to `"true"`:

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

<h2 id='nested-templates'>Nested Templates</h2>

Use the `ng-template` tag to customize [content-injection](content-injection) areas such as [eventContent](event-render-hooks). Example:

```
<full-calendar [options]="calendarOptions">
  <ng-template #eventContent let-arg>
    <b>{% raw %}{{{% endraw %} arg.event.title {% raw %}}}{% endraw %}</b>
  </ng-template>
</full-calendar>
```

Explanation:

- The template is named via the [`#` syntax](https://angular.io/guide/template-reference-variables#syntax). It must be the name of a content-injection area.
- The template accepts a single [implicit local variable](https://stackoverflow.com/questions/45055384/what-is-implicit-in-angular-2/45055768#45055768) which is named via the `let-*` syntax. In the above example, `let-arg` names the variable "arg".
- The properties of the argument are documented alongside each content-injection area. For example see [eventContent's argument](event-render-hooks#argument).

For more complex situations, a [TemplateRef](https://angular.dev/guide/templates/ng-template#referencing-a-template-fragment-with-queries) can be directly passed to the options. This is useful for nested options like [resourceColumns](resourceColumns)' `.cellContent`.

## Calendar API

Hopefully you won't need to do it often, but sometimes it's useful to access the underlying `Calendar` object for raw data and methods.

This is especially useful for controlling the current date. The [initialDate](initialDate) prop will set the _initial_ date of the calendar, but to change it after that, you'll need to rely on the [date navigation methods](date-navigation).

To do something like this, you'll need to get ahold of the [ViewChild reference][ViewChild]. In the template:

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

Once you've explicitly marked your child component (`#calendar`), you can get the underlying `Calendar` object via the `getApi` method:

```js
import { Component, ViewChild } from "@angular/core";
import { FullCalendarComponent, CalendarOptions } from "@fullcalendar/angular";
// ...

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"],
})
export class AppComponent {
  // references the #calendar in the template
  @ViewChild("calendar") calendarComponent: FullCalendarComponent;

  calendarOptions: CalendarOptions = {
    initialView: "dayGridMonth",
    plugins: [ /* ... */ ],
  };

  someMethod() {
    let calendarApi = this.calendarComponent.getApi();
    calendarApi.next();
  }
}
```

## FullCalendar Premium

How do you use [FullCalendar Premium's](/pricing) plugins with Angular? They are no different than any other plugin. Just follow the same instructions as you did `dayGridPlugin` in the above example. You'll need an additional package however:

```sh
npm install --save @fullcalendar/angular-scheduler
```

Then, initialize your calendar. Make sure to include your [schedulerLicenseKey](schedulerLicenseKey):

```js
import { Component } from "@angular/core";
import { CalendarOptions } from "@fullcalendar/angular";
import themePlugin from "@fullcalendar/angular/themes/monarch";
import resourceTimelinePlugin from "@fullcalendar/angular-scheduler/resource-timeline";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"],
})
export class AppComponent {
  calendarOptions: CalendarOptions = {
    schedulerLicenseKey: "XXX",
    plugins: [themePlugin, resourceTimelinePlugin],
  };
}
```

[Angular]: https://angular.io/
[Angular CLI]: https://cli.angular.io/
[app.component.ts]: {site.fullcalendar_examples_blob}/angular19/src/app/app.component.ts
[app.component.scss]: {site.fullcalendar_examples_blob}/angular19/src/app/app.component.scss
[app.component.html]: {site.fullcalendar_examples_blob}/angular19/src/app/app.component.html
[component options]: https://github.com/fullcalendar/fullcalendar-angular/blob/main/lib/src/options.ts
[ViewChild]: https://angular.io/api/core/ViewChild
