angular - 将 Angular cli 从 8 更新到 10 后出错
问题描述
我已将 Angular 项目从 8 升级到 10,但在编译时出现以下错误。
ERROR in node_modules/ngx-loading/lib/ngx-loading.module.d.ts:4:55 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).
4 static forRoot(loadingConfig: INgxLoadingConfig): ModuleWithProviders;
~~~~~~~~~~~~~~~~~~~
src/app/export/export.component.ts:83:24 - error TS2351: This expression is not constructable.
Type 'typeof import("jspdf")' has no construct signatures.
83 const pdfDoc = new jsPDF('l');
我无法找出这里发生了什么。
谁能帮我解决这个问题?
提前致谢!
解决方案
由于 Angular 9ModuleWithProviders
需要泛型类型来引用NgModule
.
https://angular.io/guide/migration-module-with-providers
ngx-loading 项目还没有实现这些更改。但似乎有一个拉取请求等待完成。
推荐阅读
- plot - 绘制具有最小重叠的网络
- c# - WPF ListView 项目呈现事件
- regex - 如何将正则表达式“x{m, n}”转换为 NFA?
- javascript - 无法解析nodejs中的json对象
- php - PHP, cURL, REST-API - 将具有多个值的变量放入 JSON 数组
- xcode - 谷歌演员。反应本机应用程序。Xcode:ld:未找到框架 GoogleCast
- json - 替换 BASH 脚本中的 JSON 变量
- android - 如何为 Glide V4 设置默认的淡入淡出动画
- angular - Angular - 创建从服务器检索数据并将它们发送到使用它的组件的服务的正确方法是什么?
- c# - 将数据插入drisview并在同一个gridview中显示