ng2-pagination
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -1,3 +0,10 @@ | ||
# 2.0.0 (2016-01-12) | ||
# Changelog | ||
## 2.0.1 (2017-02-23) | ||
* Fix exception when config object uses accessors for itemsPerPage and currentPage ([#128])[https://github.com/michaelbromley/ng2-pagination/issues/128]) | ||
* In-memory paging works even when `totalItems` is specified, fixes [#115](https://github.com/michaelbromley/ng2-pagination/issues/115) | ||
* Warn when using an `id` which does not match any registered with a PaginatePipe, fixes [#116](https://github.com/michaelbromley/ng2-pagination/issues/116) | ||
# 2.0.0 (2017-01-12) | ||
#### Breaking Changes | ||
@@ -4,0 +11,0 @@ * The module is being built with **Angular 2.4.3**. Therefore the metadata output is not compatible with Angular < 2.3.0. Attempting to use this version |
@@ -173,3 +173,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
} | ||
var serverSideMode = args.totalItems !== undefined; | ||
var serverSideMode = args.totalItems && args.totalItems !== collection.length; | ||
var instance = this.createInstance(collection, args); | ||
@@ -218,3 +218,3 @@ var id = instance.id; | ||
var required = ['itemsPerPage', 'currentPage']; | ||
var missing = required.filter(function (prop) { return !config.hasOwnProperty(prop); }); | ||
var missing = required.filter(function (prop) { return !(prop in config); }); | ||
if (0 < missing.length) { | ||
@@ -441,2 +441,3 @@ throw new Error("PaginatePipe: Argument is missing the following required properties: " + missing.join(', ')); | ||
PaginationControlsDirective.prototype.previous = function () { | ||
this.checkValidId(); | ||
this.setCurrent(this.getCurrent() - 1); | ||
@@ -448,2 +449,3 @@ }; | ||
PaginationControlsDirective.prototype.next = function () { | ||
this.checkValidId(); | ||
this.setCurrent(this.getCurrent() + 1); | ||
@@ -487,2 +489,7 @@ }; | ||
}; | ||
PaginationControlsDirective.prototype.checkValidId = function () { | ||
if (!this.service.getInstance(this.id).id) { | ||
console.warn("PaginationControlsDirective: the specified id \"" + this.id + "\" does not match any registered PaginationInstance"); | ||
} | ||
}; | ||
/** | ||
@@ -489,0 +496,0 @@ * Updates the page links and checks that the current page is valid. Should run whenever the |
@@ -29,3 +29,3 @@ "use strict"; | ||
} | ||
var serverSideMode = args.totalItems !== undefined; | ||
var serverSideMode = args.totalItems && args.totalItems !== collection.length; | ||
var instance = this.createInstance(collection, args); | ||
@@ -74,3 +74,3 @@ var id = instance.id; | ||
var required = ['itemsPerPage', 'currentPage']; | ||
var missing = required.filter(function (prop) { return !config.hasOwnProperty(prop); }); | ||
var missing = required.filter(function (prop) { return !(prop in config); }); | ||
if (0 < missing.length) { | ||
@@ -77,0 +77,0 @@ throw new Error("PaginatePipe: Argument is missing the following required properties: " + missing.join(', ')); |
@@ -52,2 +52,3 @@ import { ChangeDetectorRef, EventEmitter } from '@angular/core'; | ||
getLastPage(): number; | ||
private checkValidId(); | ||
/** | ||
@@ -54,0 +55,0 @@ * Updates the page links and checks that the current page is valid. Should run whenever the |
@@ -42,2 +42,3 @@ "use strict"; | ||
PaginationControlsDirective.prototype.previous = function () { | ||
this.checkValidId(); | ||
this.setCurrent(this.getCurrent() - 1); | ||
@@ -49,2 +50,3 @@ }; | ||
PaginationControlsDirective.prototype.next = function () { | ||
this.checkValidId(); | ||
this.setCurrent(this.getCurrent() + 1); | ||
@@ -88,2 +90,7 @@ }; | ||
}; | ||
PaginationControlsDirective.prototype.checkValidId = function () { | ||
if (!this.service.getInstance(this.id).id) { | ||
console.warn("PaginationControlsDirective: the specified id \"" + this.id + "\" does not match any registered PaginationInstance"); | ||
} | ||
}; | ||
/** | ||
@@ -90,0 +97,0 @@ * Updates the page links and checks that the current page is valid. Should run whenever the |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"PaginationControlsDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"pagination-template,[pagination-template]","exportAs":"paginationApi"}]}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"maxSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./pagination.service","name":"PaginationService"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"previous":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"isFirstPage":[{"__symbolic":"method"}],"isLastPage":[{"__symbolic":"method"}],"setCurrent":[{"__symbolic":"method"}],"getCurrent":[{"__symbolic":"method"}],"getLastPage":[{"__symbolic":"method"}],"updatePageLinks":[{"__symbolic":"method"}],"outOfBoundCorrection":[{"__symbolic":"method"}],"createPageArray":[{"__symbolic":"method"}],"calculatePageNumber":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"PaginationControlsDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"pagination-template,[pagination-template]","exportAs":"paginationApi"}]}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"maxSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./pagination.service","name":"PaginationService"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"previous":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"isFirstPage":[{"__symbolic":"method"}],"isLastPage":[{"__symbolic":"method"}],"setCurrent":[{"__symbolic":"method"}],"getCurrent":[{"__symbolic":"method"}],"getLastPage":[{"__symbolic":"method"}],"updatePageLinks":[{"__symbolic":"method"}],"outOfBoundCorrection":[{"__symbolic":"method"}],"createPageArray":[{"__symbolic":"method"}],"calculatePageNumber":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"PaginationControlsDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"pagination-template,[pagination-template]","exportAs":"paginationApi"}]}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"maxSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./pagination.service","name":"PaginationService"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"previous":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"isFirstPage":[{"__symbolic":"method"}],"isLastPage":[{"__symbolic":"method"}],"setCurrent":[{"__symbolic":"method"}],"getCurrent":[{"__symbolic":"method"}],"getLastPage":[{"__symbolic":"method"}],"checkValidId":[{"__symbolic":"method"}],"updatePageLinks":[{"__symbolic":"method"}],"outOfBoundCorrection":[{"__symbolic":"method"}],"createPageArray":[{"__symbolic":"method"}],"calculatePageNumber":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"PaginationControlsDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"pagination-template,[pagination-template]","exportAs":"paginationApi"}]}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"maxSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./pagination.service","name":"PaginationService"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"previous":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"isFirstPage":[{"__symbolic":"method"}],"isLastPage":[{"__symbolic":"method"}],"setCurrent":[{"__symbolic":"method"}],"getCurrent":[{"__symbolic":"method"}],"getLastPage":[{"__symbolic":"method"}],"checkValidId":[{"__symbolic":"method"}],"updatePageLinks":[{"__symbolic":"method"}],"outOfBoundCorrection":[{"__symbolic":"method"}],"createPageArray":[{"__symbolic":"method"}],"calculatePageNumber":[{"__symbolic":"method"}]}}}}] |
{ | ||
"name": "ng2-pagination", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Pagination for Angular", | ||
@@ -47,3 +47,3 @@ "main": "index.js", | ||
"@types/es6-shim": "^0.31.32", | ||
"@types/jasmine": "^2.5.35", | ||
"@types/jasmine": "2.5.41", | ||
"@types/node": "^6.0.45", | ||
@@ -50,0 +50,0 @@ "angular2-template-loader": "0.6.0", |
109626
1421