0

I am using angular-tree-component and getting array of objects like:

`const nodes = [
  { id: 1, name: 'Node 1' },                
  { id: 2, name: 'Node 2', parent_id: 1 },  
  { id: 4, name: 'Node 4' },
  { id: 5, name: 'Node 5' },
  { id: 6, name: 'Node 6', parent_id: 5 }
  { id: 7, name: 'Node 999’, parent_id: 999 }
];`

Right now it just doesn't display those fields.(like a Node 999 )

`Node 1
   - Node 2
Node 4
Node 5
   -Node 6`

Since the field Node 999 does not have a parent element, I need it to become the parent itself

`Node 1
   - Node 2
Node 4
Node 5
   -Node 6
Node 999`

Documentation of this library angular tree component

I have read all the documentation and found nothing about this

jesus
  • 1
  • 1

0 Answers0