javascript - Filter deep object based on checkbox input -


i'm not sure going wrong, filter hides itineraries in itinerary object.

my object looks (they quite big show structure):

[     { // itinerary          filters:{               stops:2          }          ... children     },     {          ... next itinerary     } ] 

my ngrepeat looks this

<div class="col-sm-12 item" data-ng-repeat="itinerary in results | filter: {itinerary: {filters: {stops: filterstops}}} | orderby: orderby" data-ng-class="{ active: resultdetails }"> 

i setting filterstops scope item so

md-checkbox aria-label="non-stop" data-ng-model="filterstops" ng-true-value="0">direct</md-checkbox> 

nothing displayed in situation, whether hardcode number of stop filter directly, or whether select via checkbox. no console errors speak of, guessing logic reach sub property in filters object flawed?

i @ loss here, appreciated.

create method in controller

$scope.filter=function(obj){   return obj.filters.stops == $scope.resultdetails; } 

add view

data-ng-repeat="itinerary in results | filter: filter | orderby: orderby"  

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -