Ich bin neu bei angularJS. Bitte helfen Sie mir, dieses Problem zu lösen oder geben Sie mir einen Vorschlag Link.Mein angular ng-table pagination funktioniert nicht
Ich verweise diesen Link für meine Paginierung https://gist.github.com/esvit/6821108, aber ich bekomme Fehler.
meiner Ansicht
<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>
und hier ist mein Winkel Code
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);
}
});
Bitte helfen Sie mir diese Fehlermeldung ich erhalte.
Wissen Sie, wenn Sie Fragen stellen und Antworten erhalten, akzeptieren Sie entweder die beste Antwort oder fragen Sie nach, warum die gegebene Antwort nicht für Sie funktioniert – Rakeschand