Open ghost opened 6 years ago
Try to change de field "nome" to "value". Remeber the struct of ng2-tree.
interface TreeModel { value: string | RenamableNode; id: string | number; children?: Array<TreeModel>; loadChildren?: ChildrenLoadingFunction; settings?: TreeModelSettings; }
You should use another method or controller to change field
So, im getting data from the database and it's something like this:
{ "nome": "ESTABELECIMENTO A", "children": [ { "nome": "Departamento A", "children": [ { "nome": "Serviço A1", "children": [] }, { "nome": "Serviço A2", "children": [] } ] }, { "nome": "Departamento B", "children": [ { "nome": "Serviço B1", "children": [] } ] } ] }
The structure of the tree has a filed named "VALUE" instead of "NOME". I've changed the structure of the tree, inside the node_modules folder, to this:
_export interface TreeModel { nome: string; id?: number; children?: TreeModel[]; loadChildren?: ChildrenLoadingFunction; settings?: TreeModelSettings; emitLoadNextLevel?: boolean; _status?: TreeStatus; _foldingType?: FoldingType;
}_
But still, im getting this :
What else do I need to change? Thank you!