0

Is it possible to filter my ng-repeat via an array or object? i currently populate via http request like this :

  <div class="ibox" ng-repeat="data in appraisals track by $index">

But, Is there a way to make this filter by array so that I can have a check list which will filter by my {{data.username}}?

Edit:

here is the controller code :

 var urlgetappraisals = './dbscripts/getAppraisals.php'

                    $http({method: 'GET', url: urlgetappraisals}).success(function(data) {

                       $scope.appraisals = data;
                       $scope.nme = [];
                       $scope.nme.push("testname");
                       $scope.nme.push("testname2");

                    }).error(function(data){

                    });

so in my html :

I want appraisals to be filtered by any of the array objects (so in this case testname and testname2

2
  • see this stackoverflow.com/questions/15454900/… Commented Jun 3, 2016 at 10:13
  • Where do you put .filters? ive tried in app.js, in the controller and in services all throw error Commented Jun 3, 2016 at 10:30

1 Answer 1

1
<input ng-model="username" type="text"/>    
<div class="ibox" ng-repeat="data in appraisals | filter:username track by $index">
Sign up to request clarification or add additional context in comments.

2 Comments

i want the filter to be an array
Give your data list test and result data you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.