mattlewis92 / angular-calendar

A flexible calendar component for angular 15.0+ that can display events on a month, week or day view.
https://mattlewis92.github.io/angular-calendar/
MIT License
2.72k stars 866 forks source link

ng add fails with standalone application #1699

Open RronKurtishi opened 10 months ago

RronKurtishi commented 10 months ago

Describe the bug ng add angular-calendar fails when trying to add module imports in Angular 17 as it is standalone by default.

For a standalone app, imports should be added inside the providers array in app.config.ts file using importProvidersFrom:

    importProvidersFrom(
      CalendarModule.forRoot({
        provide: DateAdapter,
        useFactory: adapterFactory,
      })
    )

Versions

matts-bot[bot] commented 10 months ago

Thanks so much for opening an issue! If you'd like to support this project, then please consider sponsoring me

sambyte61 commented 8 months ago

@RronKurtishi I was struggling with this same issue for a while. Your solution works for me too.

Also worth noting that you need to import importProvidersFrom from @angular/core.

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