diff --git a/src/pagination/tm.pagination.js b/src/pagination/tm.pagination.js index 2eb84c4..2c592fc 100755 --- a/src/pagination/tm.pagination.js +++ b/src/pagination/tm.pagination.js @@ -5,22 +5,24 @@ angular.module('tm.pagination', []).directive('tmPagination',[function(){ return { restrict: 'EA', - template: '
' + - '' + - '
' + - '每页' + - '/共{{ conf.totalItems }}条 ' + - '跳转至' + - '
' + - '
暂无数据
' + - '
', + template: '
' + + '' + + /** + '
' + + '每页' + + '/共{{ conf.totalItems }}条 ' + + '跳转至' + + '
' + + **/ + '
暂无数据
' + + '
', replace: true, scope: { conf: '=' @@ -58,7 +60,7 @@ angular.module('tm.pagination', []).directive('tmPagination',[function(){ // 分页选项可调整每页显示的条数 if(!conf.perPageOptions){ - conf.perPageOptions = defaultPagesLength; + conf.perPageOptions = defaultPerPageOptions; } // pageList数组 @@ -170,6 +172,10 @@ angular.module('tm.pagination', []).directive('tmPagination',[function(){ if(conf.currentPage > 1){ conf.currentPage -= 1; } + getPagination(); + if(conf.onChange) { + conf.onChange(); + } }; // nextPage @@ -177,6 +183,10 @@ angular.module('tm.pagination', []).directive('tmPagination',[function(){ if(conf.currentPage < conf.numberOfPages){ conf.currentPage += 1; } + getPagination(); + if(conf.onChange) { + conf.onChange(); + } }; // 变更当前页