My angularJS application displays the items of an object. If a single item has a certain ID I want to display a message. At the moment it does not work, what is wrong?
HTML
<div data-ng-controller="myCtrl">
<ul >
<li data-ng-repeat="item in values">
Item with id:<code>#{{item.id}}</code>
<code ng-hide="special(item.id)"> -> This id is special</code>
</li>
</ul>
</div>
NG
var app = angular.module('m', []);
app.controller('myCtrl', function ($scope) {
$scope.values = [{
id: 1
}, {
id: 2
.....
}];
$scope.filter = [4,5,6];
$scope.filterIds = function (ids) {
return function (item) {
var filter = $scope.filter;
return filter.indexOf(item.id) !== -1;
}
}
$scope.special = function (id) {
return function (id) {
var filter = $scope.filter;
return filter.indexOf(id) !== -1;
}
}
});