【发布时间】:2022-12-09 17:29:30
【问题描述】:
我有一个 Angular 项目,我想在我自己的延迟加载模块中使用第三方组件 (FullCalendarComponent),该组件在第三方模块 - FullCalendarModule 中声明。
但问题是,第三方模块(FullCalendarModule)使用了 BrowserModule,这是不应该的。
因此,我的 Angular 应用程序只能在非延迟加载模块中使用第三方组件 (FullCalendarComponent),否则会报错:
Error: Providers from the `BrowserModule` have already been loaded. If you need access to common directives such as NgIf and NgFor, import the `CommonModule` instead.
我在他们的跟踪器上创建了一个问题: https://github.com/fullcalendar/fullcalendar-angular/issues/423
但是现在有没有办法绕过它,所以我可以在延迟加载的模块中使用它?
【问题讨论】:
-
你怎么确定 fullcalendar 导入了那个模块?你检查他们的源代码了吗?
-
是的,我检查了源代码。
-
我看到相反的情况,库中没有代码导入该模块。你能把我链接到有代码的github行吗?
标签: angular fullcalendar lazy-loading angular-routing