how to avoid duplicate items with ng-repeat and drop in angularjs?
<p>Can you advice me the right sole of some issue?
I have next situation:</p>

<p>1.I load list of items from server and list it with ng-repeat in container here:</p>

<pre><code>&lt;div layout="column" id={{vm.folderId}}container flex layout-align="start center" class='container' dragula='"first-bag"'&gt;
   &lt;div id={{item.id}}child class="md-whiteframe-5dp capitalize itemsInList" layout="column"  ng-repeat="item in vm.workItems | filter:search"&gt;
      &lt;div layout="column" flex &gt;
         &lt;div class="workItemName"&gt;{{vm.getWorkItemName(item.metadata)}}&lt;/div&gt;
         &lt;div class="workItemDescription"&gt;{{vm.getWorkItemDescription(item.metadata)}}&lt;/div&gt;
      &lt;/div&gt;
   &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>So lets say we have listed next list:</p>

<pre><code>item_1
item_2
item_3
item_4
</code></pre>

<p>than I drop another element into this container, ITEM_5.
After I've droped server gives me new list: item_1 -
    item_2 -
    item_3 -
    item_4 -
    item_5
and I update my <code>vm.workItems</code> here:</p>

<pre><code>if (data.ok) {
    if (data.content.items.length != vm.workItems.length) {
        vm.workItems = data.content.items; //from server
        SharedDataService.setLastUpdateTimeStamp(SharedDataService.getNewUpdateTimeStamp());
    }
}
</code></pre>

<p>After when it ng-repeat fresh items it also view droped element in list.So in the end I have:</p>

<pre><code>item_1 //ng-repeated
item_2 //ng-repeated
item_3 //ng-repeated
item_4 //ng-repeated
item_5 //ng-repeated
item_5 //droped element
</code></pre>

<p>How to avoid this? is there some normal solving?</p>

<p>update. I drop element ,when it's droped I make request to server to ad new item to list:</p>

<pre><code>  $scope.$on('first-bag.drop', function (e, el, container) {
        var elementId = parseInt(el[0].id);
        var newContainerId = parseInt(container[0].id);
        var newPrevElementId;
        var newPrevElement = document.getElementById(el[0].id).previousElementSibling;

        if(newPrevElement) {
            newPrevElementId = parseInt(newPrevElement.getAttribute('id'));
        } else  if(!newPrevElement)  {
            newPrevElementId = newContainerId;
        }

        if(exContainerId != newContainerId) {
            WebSocketService.addItem(elementId, exContainerId,
}
}
</code></pre>