用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 })
用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 })