From 35e467641cd2f31d1c0bcc311c26a4acff65e0ee Mon Sep 17 00:00:00 2001 From: beerfekt Date: Tue, 16 Apr 2019 16:30:18 +0200 Subject: [PATCH 1/2] added classes page-item, page-link to the template, to work with bootstrap 4 --- src/directives/pagination/dirPagination.js | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/directives/pagination/dirPagination.js b/src/directives/pagination/dirPagination.js index d5103ff..dde2e58 100644 --- a/src/directives/pagination/dirPagination.js +++ b/src/directives/pagination/dirPagination.js @@ -201,9 +201,7 @@ // Replace any non-alphanumeric characters which might confuse // the $parse service and give unexpected results. // See https://github.com/michaelbromley/angularUtils/issues/233 - // Adding the '_' as a prefix resolves an issue where paginationId might be have a digit as its first char - // See https://github.com/michaelbromley/angularUtils/issues/400 - var defaultCurrentPage = '_' + (paginationId + '__currentPage').replace(/\W/g, '_'); + var defaultCurrentPage = (paginationId + '__currentPage').replace(/\W/g, '_'); scope[defaultCurrentPage] = 1; currentPageGetter = $parse(defaultCurrentPage); } @@ -224,7 +222,24 @@ } function dirPaginationControlsTemplateInstaller($templateCache) { - $templateCache.put('angularUtils.directives.dirPagination.template', ''); + $templateCache.put('angularUtils.directives.dirPagination.template', + ''); } function dirPaginationControlsDirective(paginationService, paginationTemplate) { From d8711433d666b4f96ca293d95865a7245300f299 Mon Sep 17 00:00:00 2001 From: beerfekt Date: Tue, 16 Apr 2019 16:50:37 +0200 Subject: [PATCH 2/2] re-added comment --- src/directives/pagination/dirPagination.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/directives/pagination/dirPagination.js b/src/directives/pagination/dirPagination.js index dde2e58..d40ec01 100644 --- a/src/directives/pagination/dirPagination.js +++ b/src/directives/pagination/dirPagination.js @@ -201,6 +201,8 @@ // Replace any non-alphanumeric characters which might confuse // the $parse service and give unexpected results. // See https://github.com/michaelbromley/angularUtils/issues/233 + // Adding the '_' as a prefix resolves an issue where paginationId might be have a digit as its first char + // See https://github.com/michaelbromley/angularUtils/issues/400 var defaultCurrentPage = (paginationId + '__currentPage').replace(/\W/g, '_'); scope[defaultCurrentPage] = 1; currentPageGetter = $parse(defaultCurrentPage);