0
所以我努力使引導表搜索,並提出從GET calll引導表中獲取JSON數據
<table id="example" class="table table-bordered table-striped table-hover" data-search="true">
<thead>
<tr class="text-white clickable-row" bgcolor="#578ebe" >
<th id="white-text"> # </th>
<th id="white-text"> Name </th>
<th id="white-text"> DBA </th>
<th id="white-text"> Facility ID </th>
<th id="white-text"> Active </th>
</tr>
</thead>
<tbody>
<tr ng-repeat="hospital in hospital_filtered = hospitals">
<td> <a ng-click="click(hospital)"> {{ hospital.hospital_id }} </td>
<td> <a ng-click="click(hospital)"> {{ hospital.hospital_name }} </td>
<td> <a ng-click="click(hospital)"> {{ hospital.hospital_dba }} </td>
<td> <a ng-click="click(hospital)"> {{ hospital.facility_id }} </td>
<td> <a ng-click="click(hospital)"> {{ hospital.active_flag }} </td>
</tr>
</tbody>
</table>
這裏的數據來排序是我讓從我的API GET調用。數據即將進入,但引導程序表排序和排序不起作用。這個調用如何填充引導表?
$http.get("/hospitals/all", {
params: {authtoken: $rootScope.auth_token}}
)
.then(function(response) {
// Request completed successfully
//console.log(response);
$scope.hospitals=response.data
}, function(x) {
// Request error
console.log("Error");
});
});