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