Skip to content

Commit 8594649

Browse files
authored
Update directive.js
fix bug num pages
1 parent 823e39f commit 8594649

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/directive.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,11 @@ angular.module('rs.datagrid', ['ui.utils.masks', 'ui.select'])
342342
start = 0;
343343
}
344344
scope.start = start;
345-
scope.end = angular.copy(start+4);
345+
if((start+4) <= totalPages){
346+
scope.end = angular.copy(start+4);
347+
}else{
348+
scope.end = angular.copy(totalPages-1);
349+
}
346350
}
347351

348352
function makePagination() {

0 commit comments

Comments
 (0)