weixin_39651735
2020-11-25 08:48 阅读 8

No exported member 'TreeComponent'

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?


('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?

该提问来源于开源项目:CirclonGroup/angular-tree-component

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

8条回答 默认 最新

  • weixin_39815435 weixin_39815435 2020-11-25 08:48

    +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 };

    点赞 评论 复制链接分享
  • weixin_39651735 weixin_39651735 2020-11-25 08:48

    Thank you, that gets around it for now!

    点赞 评论 复制链接分享
  • weixin_39710660 weixin_39710660 2020-11-25 08:48

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

    点赞 评论 复制链接分享
  • weixin_39955142 weixin_39955142 2020-11-25 08:48

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

    点赞 评论 复制链接分享
  • weixin_39727336 weixin_39727336 2020-11-25 08:48

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

    TypeScript Error

    no exported member 'TreeComponent'

    
    ├─┬ angular2-tree-component.3.4
    │ └── tree-kill.1.0
    

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

    点赞 评论 复制链接分享
  • weixin_39955142 weixin_39955142 2020-11-25 08:48

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

    点赞 评论 复制链接分享
  • weixin_39727336 weixin_39727336 2020-11-25 08:48

    Confirmed fixed in v1.3.5. Thank you!!

    点赞 评论 复制链接分享
  • weixin_39955142 weixin_39955142 2020-11-25 08:48

    Awesome

    点赞 评论 复制链接分享

相关推荐