CirclonGroup / angular-tree-component

A simple yet powerful tree component for Angular (>=2)
https://angular2-tree.readme.io/docs
MIT License
1.1k stars 492 forks source link

ERROR in node_modules/@circlon/angular-tree-component/lib/components/tree-node-collection.component.d.ts(5,9): error TS1086: An accessor cannot be declared in an ambient context. #855

Open pptyasar opened 4 years ago

pptyasar commented 4 years ago

ng serve command fails

ERROR in node_modules/@circlon/angular-tree-component/lib/components/tree-node-collection.component.d.ts(5,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@circlon/angular-tree-component/lib/components/tree-node-collection.component.d.ts(6,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@circlon/angular-tree-component/lib/components/tree-node-collection.component.d.ts(12,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@circlon/angular-tree-component/lib/components/tree.component.d.ts(17,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@circlon/angular-tree-component/lib/components/tree.component.d.ts(18,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@circlon/angular-tree-component/lib/components/tree.component.d.ts(19,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@circlon/angular-tree-component/lib/components/tree.component.d.ts(20,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@circlon/angular-tree-component/lib/directives/tree-animate-open.directive.d.ts(10,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@circlon/angular-tree-component/lib/directives/tree-drop.directive.d.ts(17,9): error TS1086: An accessor cannot be declared in an ambient context.

when "skipLibCheck": true, in tsconfig.json it works

Angular CLI: 7.1.4 node -v v12.16.1 npm -v 6.13.4 typescript 3.1.6 webpack 4.19.1

tobiasengelhardt commented 4 years ago

@pptyasar the @circlon/angular-tree-component package is not compatible with Angular 7. You should try and use the angular-tree-component package, probably with version 7.2.1. Please note that we focus the development on Angular 9 and up.

pptyasar commented 4 years ago

https://angular2-tree.readme.io/docs/#supported-angular-versions

I believed this @tobiasengelhardt

tobiasengelhardt commented 4 years ago

@pptyasar Sorry for the confusion, I mixed up the version numbers. But you still can not use the @circlon/angular-tree-component package with Angular 7. We are working on a new documentation that will make this clearer.

Use angular-tree-component in version 8.5.6 with Angular 7. Tested this myself and there are no errors with ng serve. Please note that the installation is slightly different because it's a different package:

Use this import in your css: @import '~angular-tree-component/dist/angular-tree-component.css'; Use this import in your app module: TreeModule.forRoot()

When you update your app to Angular 8 you can continue using the tree like that. When you are at Angular 9 or higher you should switch to the @circlon/angular-tree-component package. The imports are different and the migration path is described in the changelog.