<div ng-repeat=" x in z">
<div ng-if="function(x).y" >
display this
</div>
</div>
In the above code, ng-if function(x) is not getting called without refresh.
Please check and suggest if I am missing any thing ?
Here is working example
angular.module('app', [])
.controller('ctrl', function($scope) {
$scope.z = [1,2,3];
$scope.display = function(x) {
return x === 2
};
});
<div ng-app="app" ng-controller='ctrl'>
<div ng-repeat=" x in z">
<div ng-if="display(x)" >
display this
</div>
</div>
</div>
And fiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With