I want a drop down select and option list which displays a tree, in that sub items are indented so its obvious to the user they are child items. When I run this, literally nothing shows in the select. Ideally Id like it to display like this
My second problem is that using padding within the options wont work I have to use , but how can I pass nesting information down the template to output the required number of spaces?
<script type="text/ng-template" id="tree_option_renderer.html">
<option>{{data.Name}}</option>
<!-- Would want 1 per level to indent properly, how? -->
<option ng-repeat="data in data.Children" ng-include="'tree_option_renderer.html'">
</script>
<select id="folderList" ng-show="operatesOnSelector == 0">
<option ng-repeat="group in addressbook" ng-include="tree_option_renderer.html"></option>
</select>
My data looks a little like this:
{
Id: 0,
Name: "Level 1",
Children: [
{
Id: 1,
Name: "level 2",
Children: []
}
]
}
<select>doesn't support nested optgroups<div>there? stuff in Angular, the div was my initial attempt, the jsFiddle I provided shows it with - Ill update my question to be clearer