When I list items I need to show only items from ngRepeat. How to clear container element before list? Because now i have next (not good situation):
1.Item 1.1 Subiten
When I drug 1.1 SubItem out of 1.Item. it shows next:
1.Item 2.SubItem 3 SubItem
Here is html code:
<ol dragula='"drag-container"' >
<li class="padding-top-5 padding-bottom-5" ng-repeat="item in vm.items track by $index" data={{item.id}} id="{{item.id}}child">
<div>
<table class="md-table itemTable table-striped">
<tbody>
<tr>
<td class="autonumber"><span class="number"></span></td>
<td class="smallTableCell">{{item.id}}</td>
<td class="midleTableCell ">{{item.type.name }}</td>
</tr>
</tbody>
</table>
<ol class="subItem " layout="column" dragula='"drag-container"' id="{{item.id}}parent">
<li ng-include=" 'app/components/dashboards/home/item-component/itemComponent.tmpl.html' "
class="padding-top-5 padding-bottom-5" ng-repeat="subItem in item.children" id="{{subItem.id}}child">
</li>
</ol>
</div>
</li>
</ol>
Angularjs (updates every second):
function updateItems(data) {
if (data.ok == true) {
var itemsIncome = data.content.items;
//if lengths are different update array
if (vm.items.length != itemsIncome.length) {
vm.items = itemsIncome;
}
}
}
