This is the expected result when using track by $index
.
If you for example have ten items in the collection, the last item will have $index 9. Remove one, doesn't matter which one, and the last one will now have $index 8. This means there no longer is an element with $index 9, and as you are tracking by $index, the associated DOM element that previously had $index 9 will be removed.
You either need to remove the track by
or track by a property actually related to specific element.
Example:
<li ng-repeat="item in items track by item.id">
Demo with track by $index: http://plnkr.co/edit/Y2aGC2GOEIIDoxuVQmCA?p=preview
Demo with track by object property: http://plnkr.co/edit/xGhQ3mYIhvmwZWxnEer1?p=preview