javascript - AngularJS Filter Array with Array -
i trying use ng-repeat filter, can't seem working.
html:
<li dnd-draggable="item" ng-repeat="item in items| filter: integratefilter"> </li>
filter:
$scope.integratefilter = function (item) { return !$scope.integratesinput ? item : (item.type == $scope.itemtypes[0].type); };
the structure of data:
$scope.itemtypes array of types want filter with:
products: array[2] 0: object type: "food" 1: object type: "beverage"
the "items" in list array of objects like:
0: object name: "steak" type: "food"
so want filter items array ($scope.itemtypes). filter i'm using right returns 1 result (0) beginning of array. there way use filter this? or need loop through $scope.itemtypes?
thanks
Comments
Post a Comment