바코드로 재고를 필터링하고 싶습니다. 이렇게 할 수 있습니까? 여기서 중요한 점은 내가 전달하는 바코드가 (서버의) 바코드 인벤토리와 동일하다면 $scope.inventories
을 바코드와 일치하는 것으로 변경하는 것입니다. 그리고 $ scope.inventories는 일치하는 바코드 인벤토리로만 구성됩니다.필터 객체 데이터 angularjs
몇 가지 미친 오류가 발생했습니다. 어떤 도움, 개체 데이터를 필터링하는 방법? NG 반복에서 목록에
$scope.filterByBarcode = function(list, barcode) {
return list.filter(function(item){
return item.barcode === barcode;
});
};
필터 : 템플릿
<ul ng-repeat="inventory in inventories">
<li><a href="" ng-click="filter(inventory.barcode)">{{inventory.barcode}}</a></li>
</ul>
여기에서 나를 도울 수 있습니까? http://stackoverflow.com/questions/22712486/filter-objects-matching-details – Erick