[英]Importing angular2-calendar-heatmap causes JIT compilation error
I'm working on an Angular application (version 9.0.3) and I recently wanted to implement a calendar module, so I browsed the web and stumbled across angular2-calendar-heatmap .我正在开发一个 Angular 应用程序(版本 9.0.3),最近我想实现一个日历模块,所以我浏览了网页并偶然发现了angular2-calendar-heatmap 。 I decided this was fit for my project, so I decided to add it and it gave the following error:
我决定这适合我的项目,所以我决定添加它,但它给出了以下错误:
What I did:我做了什么:
npm install angular2-calendar-heatmap
as stated in the installation .npm install angular2-calendar-heatmap
安装了这个依赖项,如安装中所述。 What I tried我试过的
package.json
, which it is as "angular2-calendar-heatmap": "^0.2.2"
package.json
是否正确添加了依赖项,它是"angular2-calendar-heatmap": "^0.2.2"
What I already know我已经知道的
I did find a way to get rid of the error thanks to an answer in this post .多亏了这篇文章中的答案,我确实找到了摆脱错误的方法。 I simply quit the current server and restarted it with
ng serve
.我只是退出当前服务器并使用
ng serve
重新启动它。
However, I still have other errors.但是,我仍然有其他错误。 I get
Cannot declare 'CalendarHeatmap' in a NgModule as it's not a part of the current compilation.
我得到
Cannot declare 'CalendarHeatmap' in a NgModule as it's not a part of the current compilation.
because CalendarHeatmap is added in declarations, so changed it to imports, but that also didn't solve the issue because this gave the following error: Appears in the NgModule.imports of SharedModule, but could not be resolved to an NgModule class
因为在声明中添加了 CalendarHeatmap,所以将其更改为导入,但这也没有解决问题,因为这给出了以下错误:
Appears in the NgModule.imports of SharedModule, but could not be resolved to an NgModule class
However, I found another package that also offers calendars and more detailed, it's called angular calendar and seems to offer more options.然而,我发现了另一个也提供日历和更详细的包,它被称为角日历,似乎提供了更多的选择。 I also got the same error here.
我在这里也遇到了同样的错误。 I just had to close the server and restart it with
ng serve
and then I got it to work.我只需要关闭服务器并使用
ng serve
重新启动它,然后我就可以开始工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.