Help with $filter Angularjs

Asked

Viewed 81 times

1

I’m doing a screen search modal of a system I’m doing, and I’m finding the following problem when it comes to implementing the filter: I’m filtering an array of objects in an ng-repeat, each object has 3 fields, but I want to filter just two, I tried to do a function like filter: getFiltered and filter through the 2 fields, but I could not save the filtered array in a variable.

$scope.getFiltered = function(items){
    if(item.DescriptionSearch.indexOf($scope.comando.text) > -1){
        return true;
    }else if(item.Command != null){
        if(item.Command.indexOf($scope.comando.text) > -1){
            return true;
        }
    }else{
        return false;
    }
};
  • A question, where are you using the items that is as parameter?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.