2
clickイベントが発生していないため、複数のフィールドの角度jsのアドバンス検索..複数のカラムで検索を実行し、リクエストを送信することで検索butttonをクリックして検索するリクエストを1つだけ送信したい私が入力フィールドに入力するたびに。角度jsでのアドバンス検索
<script>
var app = angular.module('myApp', ['angularUtils.directives.dirPagination']);
app.controller('myCtrl', function($scope, $http) {
$http.get("<?php echo 'process.php';?>")
.then(function(response) {
$scope.prospectsList = response.data;
});
$scope.searchTable = function(){
$scope.searchParam = $scope.search ;
}
});
</script>
<tr>
<th align="center"><input type="text" ng-model="search.fname"/></th>
<th align="center"><input type="text" ng-model="search.lname"/></th>
<th align="center"><input type="text" ng-model="search.email"/></th>
<th align="center"><input type="submit" ng-model="searchList" ng-click ="searchTable();" value='Search'/> </th>
</tr>
<tr dir-paginate = "data in prospectsList |filter:searchParam|itemsPerPage:10" >
<th align="center"> {{data.first_name}} </th>
<th align="center"> {{data.last_name}} </th>
<th align="center"> {{data.email}} </th>
<th align="center"> {{data.country}} </th>
</tr>
正確に、意味 "動作していない" んでしょうか? – Claies
「検索」ボタンをクリックするとどうなりますか?そして、それが機能していないと言ったらどういう意味ですか?あなたはそれを動作させるために検索方法の中で何もしていません! – sisyphus
同じオブジェクトを割り当てるため、入力フィールドを変更するたびにフィルタが変更されます。代わりにこれを行います: '$ scope.searchParam = angular.copy($ scope.search);' – devqon