what i am trying to achieve is to show and element only if an children's value within a JSON object is equal to an string like '[]'.
I am having Json object mytree.currentNode value as
{
"Name": "Three Numbers",
"ParentId": "3",
"children": [],
"selected": "selected"
}
i show the information and i do something like:
<span ng-show="mytree.currentNode.children == '[]'">Selected Item: {{mytree.currentNode.Name}}</span>
But it is not checking the 'children' value is equal to "[ ]"
Thanks in advance
children
value inside the JSON is not the string"[]"
, it is an array[]
. Are you sure you didn't wantmytree.currentNode.children.length == 0
?