私はangularJSを初めて使う人です。この問題をスローするか、私に提案のリンクを与えるのを助けてください。私の角度テーブルのページ付けが機能しない
私のページ区切りhttps://gist.github.com/esvit/6821108のためにこのリンクを参照していますが、エラーが発生しています。
私の見解
<div class="row">
<table ng-table="tableParams" ng-cloak class="table table-bordered table-striped custom-table" ng-hide="data.length==0">
<tr>
<th>Id</th>
<th>Name</th>
<th>Email</th>
<th>Order Status</th>
<th>Contact No</th>
<th>Pensionable</th>
<th>Details</th>
<th>Assign to a Doctor</th>
</tr>
<tr ng-repeat="row in data" ng-cloak>
<td class="custom-td">{{row.id}}</td>
<td>{{row.name}}</td>
<td>{{row.email}}</td>
<td ng-style="set_color(row.OrderStatusColor)">{{row.OrderStatusName}} {{$row.OrderStatusColor}}</td>
<td>
<div ng-show="row.primary_phone == 'Mobile'">
{{row.mobilePhone}} ({{"Mobile"}})
</div>
<div ng-show="row.primary_phone == 'Work'">
{{row.workPhone}} ({{"Work"}})
</div>
<div ng-show="row.primary_phone == 'Home'">
{{row.homePhone}}({{"Home"}})
</div>
</td>
<td class="custom-td">{{row.isPensionable}}</td>
<td class="custom-td"><a href="/DashBoard/ViewDetails?pid={{row.id}}">View Details</a></td>
<td class="custom-td"><a href="" ng-click="addAppointment(row.id)">Assign</a></td>
</tr>
</table>
</div>
に取得しています私の角度コード
detailsApp.controller("patientCtrl", function ($scope, $http, ngTableParams) {
$scope.init = function() {
$scope.obj = {};
$scope.changeclass = "col-md-12";
$http({
method: "POST",
url: "/Dashboard/PatientData"
}).success(function (results) {
$scope.data = results.Data;
});
}
$scope.tableParams = new ngTableParams({
page: 1,
count: 10
}, {
total: $scope.data.length, // length of data
getData: function ($defer, params)
{
$scope.users = $scope.data.slice((params.page() - 1) * params.count(), params.page() * params.count());
$defer.resolve($scope.users);
}
});
である私を助けてください。
あなたはあなたが質問をしたときにあなたが答えを得ていることを知っていますか?あなたは最良の答えを受け入れるか、または与えられた答えがあなたのために働いていない理由 – Rakeschand