Skip to content

Modernize Angular Package for v17+ Compatibility with Standalone Support and Updated Control Flow #440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
22ffe00
chore: update package.json and pnpm-lock.yaml for FullCalendar depend…
medbenmakhlouf Jun 14, 2025
e1f0b62
chore: update Angular dependencies to v14 and target version in confi…
medbenmakhlouf Jun 14, 2025
b08fa22
chore: update Angular dependencies to v15 and adjust TypeScript targe…
medbenmakhlouf Jun 14, 2025
061652b
chore: update Angular dependencies to v16 and adjust related packages
medbenmakhlouf Jun 14, 2025
3ad0878
chore: update Angular dependencies to v17 and adjust build targets in…
medbenmakhlouf Jun 14, 2025
2eb5a44
chore: refactor template syntax to use @if directive in HTML files
medbenmakhlouf Jun 14, 2025
cc7b42a
chore: update full-calendar component template syntax for self-closin…
medbenmakhlouf Jun 14, 2025
fc00e68
chore: update full-calendar module to include OffscreenFragmentCompon…
medbenmakhlouf Jun 14, 2025
e68d815
chore: update TransportContainerComponent to be standalone and adjust…
medbenmakhlouf Jun 14, 2025
af3f18d
chore: convert FullCalendarComponent to standalone and update module …
medbenmakhlouf Jun 14, 2025
15dd2f3
chore: deprecate FullCalendarModule and update imports to use FullCal…
medbenmakhlouf Jun 14, 2025
317c8d2
chore: update full-calendar component tests to use standalone compone…
medbenmakhlouf Jun 14, 2025
ddd402b
chore: replace FullCalendarModule with FullCalendarComponent in app m…
medbenmakhlouf Jun 14, 2025
43d4fe1
chore: replace FullCalendarModule with FullCalendarComponent in app m…
medbenmakhlouf Jun 14, 2025
31981c2
chore: convert AppComponent to standalone and update imports for Full…
medbenmakhlouf Jun 14, 2025
429a280
chore: update peer dependencies for Angular to versions 17 - 19
medbenmakhlouf Jun 14, 2025
ef3be8f
chore: clean up package.json by removing unnecessary packageManager f…
medbenmakhlouf Jun 14, 2025
776329a
chore: update README to reflect changes from FullCalendarModule to Fu…
medbenmakhlouf Jun 14, 2025
d0ab83c
chore: add ChangeDetectionStrategy.OnPush to FullCalendar, OffscreenF…
medbenmakhlouf Jun 14, 2025
c7c7908
chore: update public API exports for FullCalendarComponent and FullCa…
medbenmakhlouf Jun 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,12 @@ npm install @fullcalendar/angular @fullcalendar/core @fullcalendar/daygrid

## Usage

First, connect `FullCalendarModule` to your app module:

```js
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FullCalendarModule } from '@fullcalendar/angular';
import { AppComponent } from './app.component';

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FullCalendarModule // register FullCalendar with your app
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```

Then, use the `full-calendar` component, supplying an [options](https://fullcalendar.io/docs#toc) object:
Use the `full-calendar` component, supplying an [options](https://fullcalendar.io/docs#toc) object:

```js
import { Component } from '@angular/core';
import { CalendarOptions } from '@fullcalendar/core';
import { FullCalendarComponent } from '@fullcalendar/angular';
import dayGridPlugin from '@fullcalendar/daygrid';

@Component({
Expand All @@ -50,6 +29,8 @@ import dayGridPlugin from '@fullcalendar/daygrid';
<full-calendar [options]="calendarOptions"></full-calendar>
</div>
`,
standalone: true,
imports: [FullCalendarComponent],
styleUrls: ['./app.component.scss']
})
export class AppComponent {
Expand Down Expand Up @@ -77,7 +58,7 @@ You can even supply nested templates:

## Supported Angular Versions

`@fullcalendar/angular` version 6 supports Angular 12 - 18
`@fullcalendar/angular` version 7 supports Angular 17 - 20

## Links

Expand Down
10 changes: 6 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,18 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "app:build:production"
"buildTarget": "app:build:production"
},
"development": {
"browserTarget": "app:build:development"
"buildTarget": "app:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "app:build"
"buildTarget": "app:build"
}
},
"test": {
Expand All @@ -125,5 +125,7 @@
}
}
},
"defaultProject": "lib"
"cli": {
"analytics": false
}
}
16 changes: 0 additions & 16 deletions app/.browserslistrc

This file was deleted.

19 changes: 10 additions & 9 deletions app/src/app.component.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<button (click)="updateHeader()" id="updateHeader">Update header</button>
<button (click)="updateEvents()" id="updateEvents">Update events</button>
<full-calendar
*ngIf="calendarOptions"
#fullcalendar
[options]="calendarOptions"
>
<ng-template #eventContent let-arg>
<b>{{ arg.event.title }}</b> - {{ arg.event.start.getDate() }}
</ng-template>
</full-calendar>
@if (calendarOptions) {
<full-calendar
#fullcalendar
[options]="calendarOptions"
>
<ng-template #eventContent let-arg>
<b>{{ arg.event.title }}</b> - {{ arg.event.start.getDate() }}
</ng-template>
</full-calendar>
}
14 changes: 0 additions & 14 deletions app/src/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
import { FullCalendarModule } from '@fullcalendar/angular';

describe('AppComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
FullCalendarModule
],
declarations: [
AppComponent
],
}).compileComponents();
});

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
Expand Down
4 changes: 3 additions & 1 deletion app/src/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { FullCalendarComponent } from '@fullcalendar/angular';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrls: ['./app.component.css'],
standalone: true,
imports: [FullCalendarComponent]
})
export class AppComponent implements OnInit {

Expand Down
17 changes: 0 additions & 17 deletions app/src/app.module.ts

This file was deleted.

8 changes: 4 additions & 4 deletions app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode, importProvidersFrom } from '@angular/core';
import { BrowserModule, bootstrapApplication } from '@angular/platform-browser';

import { AppModule } from './app.module';
import { AppComponent } from './app.component';
import { environment } from './environments/environment';

if (environment.production) {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
bootstrapApplication(AppComponent, {providers: [ importProvidersFrom(BrowserModule)] })
.catch(err => console.error(err));
12 changes: 0 additions & 12 deletions app/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
<T>(id: string): T;
keys(): string[];
};
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
);

// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
16 changes: 0 additions & 16 deletions lib/.browserslistrc

This file was deleted.

4 changes: 2 additions & 2 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": "12 - 19",
"@angular/core": "12 - 19",
"@angular/common": "17 - 19",
"@angular/core": "17 - 19",
"@fullcalendar/core": "~6.1.17"
}
}
22 changes: 12 additions & 10 deletions lib/src/full-calendar.component.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<offscreen-fragment>
<transport-container *ngFor="let customRendering of customRenderings; trackBy:trackCustomRendering"
[inPlaceOf]="customRendering.containerEl"
[reportEl]="customRendering.reportNewContainerEl"
[elTag]="customRendering.elTag"
[elClasses]="customRendering.elClasses"
[elStyle]="customRendering.elStyle"
[elAttrs]="customRendering.elAttrs"
[template]="customRendering.generatorMeta"
[renderProps]="customRendering.renderProps"
></transport-container>
@for (customRendering of customRenderings; track trackCustomRendering($index, customRendering)) {
<transport-container
[inPlaceOf]="customRendering.containerEl"
[reportEl]="customRendering.reportNewContainerEl"
[elTag]="customRendering.elTag"
[elClasses]="customRendering.elClasses"
[elStyle]="customRendering.elStyle"
[elAttrs]="customRendering.elAttrs"
[template]="customRendering.generatorMeta"
[renderProps]="customRendering.renderProps"
/>
}
</offscreen-fragment>
Loading