Skip to content

Commit b540304

Browse files
Release 0.9.1
See release notes
1 parent ff5ed48 commit b540304

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

.versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
2-
angularutils:[email protected].0
2+
angularutils:[email protected].1
33
44

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularUtils-pagination",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"homepage": "https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination",
55
"authors": [
66
"Michael Bromley <[email protected]>"

dirPagination.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,7 @@
2525
/**
2626
* Module
2727
*/
28-
var module;
29-
try {
30-
module = angular.module(moduleName);
31-
} catch(err) {
32-
// named module does not exist, so create one
33-
module = angular.module(moduleName, []);
34-
}
35-
36-
module
28+
angular.module(moduleName, [])
3729
.directive('dirPaginate', ['$compile', '$parse', 'paginationService', dirPaginateDirective])
3830
.directive('dirPaginateNoCompile', noCompileDirective)
3931
.directive('dirPaginationControls', ['paginationService', 'paginationTemplate', dirPaginationControlsDirective])
@@ -47,6 +39,7 @@
4739
return {
4840
terminal: true,
4941
multiElement: true,
42+
priority: 100,
5043
compile: dirPaginationCompileFn
5144
};
5245

@@ -56,7 +49,7 @@
5649
// regex taken directly from https://github.com/angular/angular.js/blob/v1.4.x/src/ng/directive/ngRepeat.js#L339
5750
var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
5851

59-
var filterPattern = /\|\s*itemsPerPage\s*:\s*(.*\(\s*\w*\)|([^\)]*?(?=as))|[^\)]*)/;
52+
var filterPattern = /\|\s*itemsPerPage\s*:\s*(.*\(\s*\w*\)|([^\)]*?(?=\s+as\s+))|[^\)]*)/;
6053
if (match[2].match(filterPattern) === null) {
6154
throw 'pagination directive: the \'itemsPerPage\' filter must be set.';
6255
}
@@ -188,8 +181,11 @@
188181
if (attrs.currentPage) {
189182
currentPageGetter = $parse(attrs.currentPage);
190183
} else {
191-
// if the current-page attribute was not set, we'll make our own
192-
var defaultCurrentPage = paginationId + '__currentPage';
184+
// If the current-page attribute was not set, we'll make our own.
185+
// Replace any non-alphanumeric characters which might confuse
186+
// the $parse service and give unexpected results.
187+
// See https://github.com/michaelbromley/angularUtils/issues/233
188+
var defaultCurrentPage = (paginationId + '__currentPage').replace(/\W/g, '_');
193189
scope[defaultCurrentPage] = 1;
194190
currentPageGetter = $parse(defaultCurrentPage);
195191
}

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package.describe({
22
name: 'angularutils:pagination',
33
summary: 'Magical automatic pagination for anything in AngularJS',
4-
version: '0.9.0',
4+
version: '0.9.1',
55
git: 'https://github.com/Urigo/angularUtils-pagination'
66
});
77

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-utils-pagination",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"description": "Magical automatic pagination for anything in AngularJS",
55
"main": "dirPagination.js",
66
"scripts": {

0 commit comments

Comments
 (0)