安装后angular-autofocus-fix
导入自动对焦模块
当我运行角度项目时,它显示以下错误:
ERROR in node_modules/angular-autofocus-fix/index.d.ts:4:23 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).
static forRoot(): ModuleWithProviders
当我签入该node_mudule时
我在我的项目中使用 Angular 10。
通过添加下面给出的代码片段app.module.ts
解决了问题
declare module "@angular/core" {
interface ModuleWithProviders<T = any> {
ngModule: Type<T>;
providers?: Provider[];
}
}
@NgModule({
// ......
})
export class AppModule { }
就我而言,这个问题是在升级时发生的ng-bootstrap
版本在angular-10
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)