If you're using ng-repeat
with orderBy
, try the approach from this post
to delete item.
Might looks like this:
HTML:
....
<tr ng-repeat="user in users | orderBy:'name':true">
<td data-title="'Name'">
<span ng-bind="user.name"></span>
<button ng-click="remove(user)"></td>
</tr>
...
In controller:
$scope.remove = function(user){
$scope.users.splice($scope.users.indexOf(user), 1);
}