var target = 1;
var fitFun = function(data,target){
var result = [];
angular.forEach(data,function(value,key){
if(value.id==target){result.push(data[key])};
})
return result;
};
var t = fitFun(data,target);
console.log(t);
I agree with the above, just use the official ones. For example, the official filters cannot meet the requirements, such as | date: There is no filtering of dates into Chinese, so just use JS to write a .filter filter yourself
The official has its own filtering specified attributes, which are included in the official examples
https://docs.angularjs.org/ap...
I agree with the above, just use the official ones. For example, the official filters cannot meet the requirements, such as | date: There is no filtering of dates into Chinese, so just use JS to write a .filter filter yourself