TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed elbarbary
NA
1.6k
278.3k
How to convert this code from angular js to typescript angu7
May 6 2020 7:45 PM
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;
// Limit number for pagination display number.
$scope.totalCount = 0;
// Total number of items in all pages. initialize as a zero
$scope.pageIndex = 1;
// Current page number. First page is 1.-->
$scope.pageSizeSelected = 5;
// Maximum number of items per page.
$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;
});
}
//Loading employees list on first time
$scope.getEmployeeList();
//This method is calling from pagination number
$scope.pageChanged =
function
() {
$scope.getEmployeeList();
};
//This method is calling from dropDown
$scope.changePageSize =
function
() {
$scope.pageIndex = 1;
$scope.getEmployeeList();
};
});
Reply
Answers (
1
)
How to display dynamic data and dynamic header on angular 7
Export to excel not working when export any json data object