Angularjs filter with custom function from controller -
i trying filter table based on age conditions less , greater 25 years.
the filtering function not happening expected. less 25 returns no results , greater 25 returns 44 , 25.
kindly let me know how results correct?
vm.filterbyagefn = function(subject){ filterreturn = true; if(vm.filterbyage){ switch(vm.filterbyage){ case '<25': if(parseint(subject.age) >= 25){ filterreturn = false} case '>25': if(parseint(subject.age) < 25){ filterreturn = false} } } return filterreturn; }
why less , greater backwards?
the less , greater in switch doesn't match string case not mention i'm not sure strong case real idea. use , object hold key less , greater than.
Comments
Post a Comment