Easy
Given the following filter:
app
.filter('customFilter', function () {
var out;
return function (list) {
out = [];
angular.forEach(list, function (item) {
if(item.data > 100) {
out.push(item);
}
});
};
});
And given:
$scope.list = [{
name : 'a',
data : 110,
processed: false
}, {
name : 'b',
data : 99,
processed: true
}, {
name : 'c',
data : 200,
processed: true
}];
what will be the result of
<span ng-repeat="item in list | customFilter | filter: {'processed': true'}">{{item.name}}</span>
Author: Mathieu RobinStatus: PublishedQuestion passed 86 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
1
How to get all the values of an array in AngularJS1
How to access the parent scope in AngularJS1
What is the name of the AngularJS class that is used to create a singleton service?1
What is the value of the expression `promise.then(null, function() {})` if `promise` is rejected with an error?2
A way to modify the native behavior of a service1
Add an entry to the browser history1
Add features and data to the $scope