I want to hide ul
s if they are empty:
<div class="nav-manage clearfix" ng-app="linksManager">
<script type="text/ng-template" id="inner-list.html">
<li ng-repeat='link in link.submenu'>
<a href="{{link.url}}">{{link.text}}</a>
<div ng-switch on="link.submenu">
<ul class="sortable" ng-include="'inner-list.html'">
</div>
</li>
</script>
<div class="links-arrange" ng-controller="linksRarrange">
<ul class="sortable">
<li ng-repeat="link in links">
<a href="{{link.url}}">{{link.text}}</a>
<div ng-switch on="link.submenu">
<ul class="sortable" ng-include="'inner-list.html'"></ul>
</div>
</li>
</ul>
</div>
But they are not hidden regardless of the content in the ng-switch on
This is the data structure:
var linksData = [
{
text: 'Menu Item 1',
url: '#'
}, {
text: 'Menu Item 2',
url: '#',
submenu: [
{
text: 'Sub-menu Item 3',
url: '#'
}, {
text: 'Sub-menu Item 4',
url: '#',
submenu: // etc ...
];