I am trying to apply filter in list view .Whenever I typed anything in input field it filter my list .I am able to filter when I write username which is visible to user .example when I write “pa” it sort my list and display only one row .that is correct.but when I write on “keyword filter” which is not visible to user it doesn’t filter .In other words when I type “Angular js” on second input field (“keyword filter”) ..It should display pab..Because “pab” have Angular js keyword .
here is my code
http://plnkr.co/edit/TccgJydcZNkXQGpnbbP0?p=preview
// Code goes here
angular.module('myApp', [])
.controller('myCtrl', function($scope){
$scope.users = [
{firstname: 'john', lastname: 'smith',
keywords: ["HTML", "CSS", "JavaScript", "jQuery", "Photoshop"]
},
{firstname: 'pab', lastname: 'due',
keywords: ["Ruby on Rails", "PostgreSQL", "AngularJS", "Node.js"]
},
{firstname: 'bob', lastname: 'rand', keywords: ["java", "php", "test", "jira"]
}
];
});
2
Answers
In your
ng-repeat
you are not filtering after your keyword input – you missed it. Just include it as follows:you just need to add the the same ng-model on the second input :
plunker: http://plnkr.co/edit/Nqp45xwrZqPLIWDtjGvQ?p=preview
hope helps good luck.