angular-tree-component:Generic type 'ModuleWithProviders<T>' requires 1 type argument(s)

Viewed 587

i am using angular v10 and "angular-tree-component": "^8.5.6".but getting build error:

ERROR in node_modules/angular-tree-component/dist/angular-tree-component.d.ts:25:23 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).

25     static forRoot(): ModuleWithProviders;

Using in the application like this

@NgModule({
  imports: [TreeModule],
   exports: [TreeModule]
   })

export class SharedModule { }

anything i have to do modification?

Thanks.

1 Answers

instead of "angular-tree-component", use the new library "@circlon/angular-tree-component"

npm uninstall angular-tree-component
npm i @circlon/angular-tree-component

and then, update all imports in your project from:

import {TreeComponent} from 'angular-tree-component';

to:

import {TreeComponent} from '@circlon/angular-tree-component';

and css if needed from:

@import '~angular-tree-component/dist/angular-tree-component.css';

to

@import "~@circlon/angular-tree-component/css/angular-tree-component.css";
Related