0
我有一個situtation在我的前面的代碼是2000到3000行,所以我不想angular
$http
到populate
我的網頁上的所有數據。而我想search
功能php
populated
數據。有沒有什麼辦法來搜索上,而與angularjs循環填充數據
問題:如何包括angular
搜索功能php populated data
?
我的搜索按鈕:
<input type="search" ng-model="searchText" ng-change="search()"/>
我的控制器:
myApp.controller('clickListenerCtrl',function($scope,$http){
$scope.search = function(){
console.log($scope.searchText); // im able get typed text
}
});
我while循環:
<table ng-controller="clickListenerCtrl">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<?php while($row = ......){ ?>
<tr>
<td><?php echo $row['id'] ?></td>
<td><?php echo $row['name'] ?></td>
</tr>
<?php } ?>
</table>
在覈心angularjs我們可以做這樣的(解決方案):
<table ng-controller="clickListenerCtrl">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="x in data | filter:searchText">
<td>{{x.id}}</td>
<td>{{x.name}}</td>
</tr>
</table>
請幫我在此先感謝!!!!!!!!!!!!!!!!!!!!!! !
? –
角度搜索 – EaB
爲「人口稠密」的前端 – EaB