Ngx引导和Angular 9 ModuleWithProviders错误
我得到下面的错误Ngx引导和Angular 9 ModuleWithProviders错误,angular,bootstrap-4,ngx-bootstrap,angular9,ngx-bootstrap-popover,Angular,Bootstrap 4,Ngx Bootstrap,Angular9,Ngx Bootstrap Popover,我得到下面的错误 ERROR in node_modules/ngx-bootstrap/popover/popover.module.d.ts:3:23 - error NG6005: PopoverModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders ty
ERROR in node_modules/ngx-bootstrap/popover/popover.module.d.ts:3:23 - error NG6005:
PopoverModule.forRoot returns a ModuleWithProviders type without a generic type argument.
Please add a generic type argument to the ModuleWithProviders type.
If this occurrence is in library code you don't control, please contact the library authors.
我刚刚添加了Ngx引导的Popover模块,并导入了PopoverModule.forRoot。这似乎是不相容的。如何解决这个问题 我解决这个错误的方法太小了 我只需运行ng add ngx引导-组件popover 它说:
Skipping installation: Package already installed
Unknown option: '--component'
Unknown option: 'popover'
但是当我为这个项目服务时,它还是成功地运行了 您需要将以下脚本添加到package.json中
{
"scripts": {
"postinstall": "ngcc"
}
}
然后运行npmi
请参阅说明此问题应在最新版本中修复,该版本正确适用于6.0.0中的Angular 9。
此外,它还支持角度10。Noe:这也可以通过指定完整路径来解决
import { PopoverModule } from 'ngx-bootstrap/popover';