angular-tree-component icon indicating copy to clipboard operation
angular-tree-component copied to clipboard

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.

Open pptyasar opened this issue 5 years ago • 3 comments

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

pptyasar avatar Aug 19 '20 09:08 pptyasar

@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.

tobiasengelhardt avatar Aug 26 '20 07:08 tobiasengelhardt

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

I believed this @tobiasengelhardt

pptyasar avatar Aug 27 '20 05:08 pptyasar

@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.

tobiasengelhardt avatar Aug 27 '20 06:08 tobiasengelhardt