Angular error – Generic type ‘ModuleWithProviders’ requires 1 type argument(s)

@user9882419 has the best approach i believe. Here is an example to illustrate what he is saying

export class AppSharedModule {
  static forRoot(): ModuleWithProviders<AppSharedModule> {
    return {
      ngModule: AppSharedModule
    };
  }
}

Leave a Comment