I would like to create a treeview table from this model:
[
{Id: 1,
Type: Item
},
{Id: 2,
Type: Group,
Children[
{Id: 3,
Type: Item
},
{Id: 4,
Type: Item
},
{Id: 5,
Type: Group,
Children[
{Id: 6,
Type: Item
},
.... //there may be an infinite number of node
]
}]
},
{Id: x,
Type: Item
}
But I can't figure out how to do that using directives and ng-repeat.
Result may be like this :
----------------------------------------------------
| Item 1 |
----------------------------------------------------
| Group 2 |
----------------------------------------------------
| Item 3 |
----------------------------------------------------
| Item 4 |
----------------------------------------------------
| Group 5 |
----------------------------------------------------
| Item 7 |
----------------------------------------------------
[...]
----------------------------------------------------
| Item x |
----------------------------------------------------
I tried to nest multiple tbody using recursive directive in my table, but it doesn't work.
Any solution ?
ng-repeat