ng2-pagination
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -1,2 +0,7 @@ | ||
# 0.3.1 (2016-05-12) | ||
# 0.3.2 (2016-06-09) | ||
* Use OnPush change detection strategy for big efficiency gains ([PR #40](https://github.com/michaelbromley/ng2-pagination/pull/40)) | ||
* Occasional flickering of active page link when changing pages also handled by the above. | ||
* (build) Update Typings to 1.x | ||
# 0.3.1 (2016-06-02) | ||
* Fix broken change detechtion when replacing collection items with new values ([PR #36](https://github.com/michaelbromley/ng2-pagination/pull/36)). | ||
@@ -3,0 +8,0 @@ * Various small fixes and added a test ([PR #33](https://github.com/michaelbromley/ng2-pagination/pull/33)). |
@@ -296,5 +296,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
PaginationControlsCmp = (function () { | ||
function PaginationControlsCmp(service) { | ||
function PaginationControlsCmp(service, changeDetectorRef) { | ||
var _this = this; | ||
this.service = service; | ||
this.changeDetectorRef = changeDetectorRef; | ||
this.maxSize = 7; | ||
@@ -310,2 +311,3 @@ this.pageChange = new core_3.EventEmitter(); | ||
_this.updatePageLinks(); | ||
_this.changeDetectorRef.markForCheck(); | ||
} | ||
@@ -509,5 +511,6 @@ }); | ||
template: template_1.DEFAULT_TEMPLATE, | ||
styles: [template_1.DEFAULT_STYLES] | ||
styles: [template_1.DEFAULT_STYLES], | ||
changeDetection: core_3.ChangeDetectionStrategy.OnPush | ||
}), | ||
__metadata('design:paramtypes', [pagination_service_2.PaginationService]) | ||
__metadata('design:paramtypes', [pagination_service_2.PaginationService, core_3.ChangeDetectorRef]) | ||
], PaginationControlsCmp); | ||
@@ -514,0 +517,0 @@ return PaginationControlsCmp; |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter } from '@angular/core'; | ||
import { EventEmitter, ChangeDetectorRef } from '@angular/core'; | ||
import { PaginationService } from "./pagination-service"; | ||
@@ -9,2 +9,3 @@ export interface IPage { | ||
private service; | ||
private changeDetectorRef; | ||
id: string; | ||
@@ -21,3 +22,3 @@ maxSize: number; | ||
private _autoHide; | ||
constructor(service: PaginationService); | ||
constructor(service: PaginationService, changeDetectorRef: ChangeDetectorRef); | ||
ngOnInit(): void; | ||
@@ -24,0 +25,0 @@ ngOnChanges(): void; |
@@ -15,5 +15,6 @@ "use strict"; | ||
var PaginationControlsCmp = (function () { | ||
function PaginationControlsCmp(service) { | ||
function PaginationControlsCmp(service, changeDetectorRef) { | ||
var _this = this; | ||
this.service = service; | ||
this.changeDetectorRef = changeDetectorRef; | ||
this.maxSize = 7; | ||
@@ -29,2 +30,3 @@ this.pageChange = new core_1.EventEmitter(); | ||
_this.updatePageLinks(); | ||
_this.changeDetectorRef.markForCheck(); | ||
} | ||
@@ -228,5 +230,6 @@ }); | ||
template: template_1.DEFAULT_TEMPLATE, | ||
styles: [template_1.DEFAULT_STYLES] | ||
styles: [template_1.DEFAULT_STYLES], | ||
changeDetection: core_1.ChangeDetectionStrategy.OnPush | ||
}), | ||
__metadata('design:paramtypes', [pagination_service_1.PaginationService]) | ||
__metadata('design:paramtypes', [pagination_service_1.PaginationService, core_1.ChangeDetectorRef]) | ||
], PaginationControlsCmp); | ||
@@ -233,0 +236,0 @@ return PaginationControlsCmp; |
{ | ||
"name": "ng2-pagination", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Pagination for Angular2", | ||
"main": "index.js", | ||
"scripts": { | ||
"typings:install": "node node_modules/typings/dist/bin install", | ||
"build:system": "node node_modules/typescript/bin/tsc -p tsconfig.system.json", | ||
@@ -58,2 +59,3 @@ "build:cjs": "node node_modules/typescript/bin/tsc", | ||
"typescript": "^1.8.0", | ||
"typings": "^1.0.4", | ||
"webpack": "^1.12.9", | ||
@@ -60,0 +62,0 @@ "zone.js": "0.6.12" |
@@ -65,4 +65,4 @@ # Angular2 Pagination | ||
The PaginatePipe should be placed at the end of an NgFor expression. It accepts a single argument, an object confirming | ||
to `IPaginationInstance`. The following config options are available: | ||
The PaginatePipe should be placed at the end of an NgFor expression. It accepts a single argument, an object conforming | ||
to the `IPaginationInstance` interface. The following config options are available: | ||
@@ -77,4 +77,4 @@ ```HTML | ||
* **`itemsPerPage`** [`number` - **required**] The number of items to display on each page. | ||
* **`currentPage`** [`number` - **required**] The current (active) page number. | ||
* **`itemsPerPage`** [`number`] - **required** The number of items to display on each page. | ||
* **`currentPage`** [`number`] - **required** The current (active) page number. | ||
* **`id`** [`string`] If you need to support more than one instance of pagination at a time, set the `id` and ensure it | ||
@@ -189,7 +189,7 @@ matches the id set in the PaginatePipe config (see below). | ||
Requires globally-installed node, npm, typings. | ||
Requires globally-installed node (tested with v5.x) & npm. | ||
``` | ||
npm install | ||
typings install | ||
npm run typings:install | ||
@@ -196,0 +196,0 @@ npm run test // Karma unit tests |
70801
1221
27