After installed angular-autofocus-fix
imported the AutofocusModule
When i run the angular projects its shows below error:
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
When i check in that node_mudule
I am using angular 10 in my project.
By adding this below given code snippet in app.module.ts
fixed the issue
declare module "@angular/core" {
interface ModuleWithProviders<T = any> {
ngModule: Type<T>;
providers?: Provider[];
}
}
@NgModule({
// ......
})
export class AppModule { }
In my case, this problem happened when I upgraded ng-bootstrap
version in angular-10
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With