0

I'm creating a table using ng-repeat and I want to implement paging below that table.

Controller:

    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!");
        })
    };

View:

    <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>
James Z
  • 12,209
  • 10
  • 24
  • 44
LogicalDesk
  • 1,237
  • 4
  • 16
  • 46

0 Answers0