Angularjs filter with custom function from controller -


i trying filter table based on age conditions less , greater 25 years.

here demo fiddle

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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -