I started using the Clarity Design Angular project and ran into a problem with the recursive Tree View template that was introduced in 0.10.0-alpha.
https://plnkr.co/edit/KK8rVH1xUGCO7VetgomA?p=preview
selectableRoot = {
"@name": "A1",
"selected": false,
"expanded": true,
"children": [
{
"@name": "B1",
"selected": false,
"children": [
{ "@name": "C1" },
{ "@name": "C2" },
{ "@name": "C3" }
]
},
{
"@name": "B2",
"selected": true,
"expanded": true,
"children": [
{ "@name": "D1" },
{
"@name": "D2",
"selected": false
},
{ "@name": "D3" }
]
},
{
"@name": "B3",
"selected": true,
"children": [
{ "@name": "E1" },
{ "@name": "E2" },
{
"@name": "E3",
"children":
{ "@name": "F1" }
}
]
}
]
};
When a recursive check finds a match that does not contain an array (but only an object - see A1> B3> E3> F1), it cannot display this element and causes an error when any folded section duplicates children by clicking on the carriage.
You do not know how to fix this if the API that sends the JSON does not put the children in an array if there is only one instance. Recursion should take into account cases when there is only one child (and is not inside the array).