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

No exported member 'TreeComponent'

Open SmartieCodes opened this issue 10 years ago • 8 comments

I've recently updated my treeview component to 1.3.2 and I'm running into the follow error:

Error:(5, 10) TS2305: Module '"node_modules/angular2-tree-component/dist/angular2-tree-component"' has no exported member 'TreeComponent'.

import { TreeComponent, TreeNode } from 'angular2-tree-component';`

I tried changing this to TreeModule but wasn't sure that was correct, should the view child be a treeModule? That doesn't seem right?

@ViewChild('tree')
tree: TreeModule;

It also complains about treeModel not being a property of tree, which is a treeModal, which makes sense.

let node: TreeNode = this.tree.treeModel.getNodeById(this.page.parentId);

How should I reference the tree now?

SmartieCodes avatar Oct 07 '16 13:10 SmartieCodes

+1, workaround is to open angular2-tree-component.d.ts in node_modules/angular2-tree-component'and add the following line:

import { TreeComponent } from './components/tree.component';

and add TreeComponent to the export like this:

export { TreeModel, TreeNode, ITreeOptions, TREE_ACTIONS, KEYS, IActionMapping, IActionHandler, TreeComponent };

alexciesielski avatar Oct 07 '16 14:10 alexciesielski

@ciesielskico Thank you, that gets around it for now!

SmartieCodes avatar Oct 07 '16 15:10 SmartieCodes

PR #62 should fix this issue along with adding support for AoT compiled apps.

isaacplmann avatar Oct 07 '16 15:10 isaacplmann

Yup, just waiting for @isaacplmann to comment on PR #62, once it's closed we can close this issue as well

adamkleingit avatar Oct 15 '16 10:10 adamkleingit

I am still seeing this error, even after upgrading to v1.3.4 (ce2986dcb4ff7b83b75a8455d4ec7315c127c9f4)

TypeScript Error

no exported member 'TreeComponent'

├─┬ [email protected]
│ └── [email protected]

Should this be the case, or must #62 still be merged first?

pixelchutes avatar Oct 18 '16 17:10 pixelchutes

It should be solved in 1.3.4 - checking....

adamkleingit avatar Oct 19 '16 13:10 adamkleingit

Confirmed fixed in v1.3.5. Thank you!!

pixelchutes avatar Oct 19 '16 17:10 pixelchutes

Awesome

adamkleingit avatar Oct 20 '16 06:10 adamkleingit