angular-tree-component not working in component

2019-08-27 11:46发布

问题:

I had been use jhipster gen a web application,need display a tree in component, according doc of https://angular2-tree.readme.io/docs in main.component.html, and main.component.ts add it display OK, but in home.component.html and home.component.ts add same code, it render empty node.

回答1:

in home.modules.ts add follow line import { TreeModule} from 'angular-tree-component'; then import TreeModule,it is OK.