Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 924
cj devin Avatar asked Jun 20 '26 00:06

cj devin


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";
like image 95
Lautaro Lorenz Avatar answered Jun 21 '26 14:06

Lautaro Lorenz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!