angular 自定义filter

用modul.filter

 1 .filter("fiilterCity",function(){
 2              return function(obj){
 3             var newObj = [];
 4            angular.forEach(obj,function(o){
 5                     if(o.city === "上海"){
 6                         newObj.push[o]
 7                     }
 8                 })
 9                   return newObj
10 }
11 })

 

posted @ 2016-04-25 16:08  -小白白白  阅读(294)  评论(0编辑  收藏  举报