使用MVC在AngularJS中分页
我正在使用ng repeat创建一个表,我想在该表下面实现分页 控制器:使用MVC在AngularJS中分页,angularjs,asp.net-mvc,asp.net-mvc-4,Angularjs,Asp.net Mvc,Asp.net Mvc 4,我正在使用ng repeat创建一个表,我想在该表下面实现分页 控制器: var app = angular.module('myApp', []); $scope.GetAllData = function () { $http({ method: "post", url: "http://localhost:12345/Employee/Get_AllEmployee" }).then(funct
var app = angular.module('myApp', []);
$scope.GetAllData = function () {
$http({
method: "post",
url: "http://localhost:12345/Employee/Get_AllEmployee"
}).then(function (response) {
$scope.employees = response.data;
}, function () {
alert("Error Occured!");
})
};
视图:
身份证件
名称
城市
接触
电子邮件ID
行动
{{Emp.CustomerID}
{{Emp.Name}
{{Emp.Address}
{{Emp.Mobileno}}
{{Emp.EmailID}
您试图实现什么分页?我尝试使用BootstrapUI和dirPagination,但未能成功。您可以添加plunker或相同的代码示例来分析您面临的问题吗?您可以遵循此问题,不要在注释中添加代码。这是不可读的。在问题中加入代码。
<div ng-app="myApp" style="margin:5px 5px 5px 5px">
<div ng-controller="myCtrl" ng-init="GetAllData()" class="divList">
<table cellpadding="12" class="table table-bordered table-hover">
<thead>
<tr>
<td>
<b>ID</b>
</td>
<td>
<b>Name</b>
</td>
<td>
<b>City</b>
</td>
<td>
<b>Contact</b>
</td>
<td>
<b>EmailID</b>
</td>
<td class="col-md-2">
<b>Actions</b>
</td>
</tr>
</thead>
<tr ng-repeat="Emp in filteredEmp | filter: queryText">
<td>
{{Emp.CustomerID}}
</td>
<td>
{{Emp.Name}}
</td>
<td>
{{Emp.Address}}
</td>
<td>
{{Emp.Mobileno}}
</td>
<td>
{{Emp.EmailID}}
</td>
<td>
<input type="button" class="btn btn-warning" value="Update" ng-click="UpdateEmp(Emp)" />
<input type="button" class="btn btn-danger" value="Delete" ng-click="DeleteEmp(Emp)" />
</td>
</tr>
</table>