angular ng-repeat with condition

前端 未结 4 1909
猫巷女王i
猫巷女王i 2020-12-09 12:07

How do you do something like this in angular with ng-repeat? I\'ll be using the example from the documentation which inits an array with 2 friends, what if I wanted to only

4条回答
  •  庸人自扰
    2020-12-09 12:19

    Here is the working fiddle

       $scope.call = function(a){
    
        if (a.age > 26)
            return true;
        else
            return false;
    
    }
    

提交回复
热议问题