How to convert this code from angular js to typescript anguar 7 ?
I work on project do pagination for data returned
but i have this code as angular js
currently i work on angular 7 project and i need to do pagination
so I need to convert this code from angular js to angular 7
so How to do that please ?
- var app = angular.module('employeeApp', ['ui.bootstrap']);
- app.controller('employeeCtrl', function ($scope, $http) {
- $scope.maxSize = 5;
- $scope.totalCount = 0;
- $scope.pageIndex = 1;
- $scope.pageSizeSelected = 5;
- $scope.getEmployeeList = function () {
- $http.get("http://localhost:52859/api/Employee?pageIndex=" + $scope.pageIndex + "&pageSize=" + $scope.pageSizeSelected).then(
- function (response) {
- $scope.employees = response.data.employees;
- $scope.totalCount = response.data.totalCount;
- },
- function (err) {
- var error = err;
- });
- }
-
- $scope.getEmployeeList();
-
- $scope.pageChanged = function () {
- $scope.getEmployeeList();
- };
-
- $scope.changePageSize = function () {
- $scope.pageIndex = 1;
- $scope.getEmployeeList();
- };
- });