我想删除单击删除按钮时的条件列表项。现在只有过滤器正在刷新。表格没有被删除。建议通过这个。从div中删除生成的元素angularjs
HTML
<ul class="list-unstyled"> <li style="display: inline-block" ng-repeat="crtia in newCriteria" > <table> <tr> <td> <select class="input-sm" ng-model="crtia.name" ng-options="searchopt for searchopt in searchcriteria " ng-click="searchy.check()"></select> </td> <td> <input class="input-sm " ng-model="crtia.value" placeholder="{{crtia.name}}" ng-change="newList()" ng-click="searchy.check()" /> </td> <td> <button type="button" class="btn btn-danger btn-xs" aria-label="Left Align" ng-click="removeCriteria($index)"> <span class="glyphicon glyphicon-remove" aria-hidden="true" ></span> </button> </td> </tr> </table> </li> </ul>
JS
$scope.removeCriteria=function($index){ $scope.searchy.check(); alert($index); $scope.newCriteria.splice($index,1); $scope.newList(); //Refreshes the filter }
plunkr:http://plnkr.co/edit/3yOmiIJ9Yu9RfAgmuVA7 –
我正在修理你的问题等待 – Shohel