AngularJS filter on multiple parameters

I have table that is populated from $scope and two search textboxes in header that I am using to filter user name and e-mail:

<table class="table">
<thead>
<tr>
    <th></th>
    <th><input type="search" placeholder="Search" ng-model="searchName"></th>
    <th><input type="search" placeholder="Search" ng-model="searchMail"> </th>
    <th></th>
</tr>
<tr>
    <th>ID</th>
    <th>Name</th>
    <th>email</th>
    <th>password</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="q in dataForTable | filter:{user_fullname : searchName, user_email : searchMail}">
    <td>{{q.user_id}}</td>
    <td>{{q.user_fullname}}</td>
    <td>{{q.user_email}}</td>
    <td>{{q.user_password}}</td>
</tr>
</tbody>    

dataForTable comes from controller via $http :

$http.get('http://tbrzica.comli.com/rest/index.php/simple/users').success(function(data){
   $scope.dataForTable=data;

});

But when the page initially load, table is empty. Only when I write something in textboxes and delete the input, table is populated and search by both condition is working normally. Is this some kind of bug?
Thanks in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>