官网后台管理,有个树结构要展示,之前用过 angular-tree-component,直接拿过来用
说下文件结构:
系统模块里的功能模块,用到了 share 模块里的 ros-tree 树组件,share 中也 import 了 对应的 TreeModule,并且 system 也引入了 shareModule :
在5中,这样的引用是没问题的,而且树组件会正常显示,但是到了9,报了个错误:No provider for TreeDraggedElement !
大致意思就是,根模块要引入 TreeModule.forRoot(),其他用到树组件的地方则需要引入 TreeModule
shareModule 加上 TreeModule.forRoot(), systemModule 加上 TreeModule ,再跑果然没错误了~