From e4547e747ce2a4be9b59e71ed60ef412b559c13e Mon Sep 17 00:00:00 2001 From: Dmitriy Shekhovtsov Date: Wed, 7 Dec 2016 18:14:46 +0200 Subject: [PATCH] fix(pagination): added support of reactive forms --- src/pagination/pagination.component.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pagination/pagination.component.ts b/src/pagination/pagination.component.ts index 16067c5781..ab00b37330 100644 --- a/src/pagination/pagination.component.ts +++ b/src/pagination/pagination.component.ts @@ -1,7 +1,7 @@ import { - Component, ElementRef, EventEmitter, Input, OnInit, Output, Renderer, Self + Component, ElementRef, EventEmitter, Input, OnInit, Output, Renderer, Self, forwardRef } from '@angular/core'; -import { ControlValueAccessor, NgModel } from '@angular/forms'; +import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { KeyAttribute } from '../utils/common'; import { PaginationConfig } from './pagination.config'; @@ -11,6 +11,12 @@ export interface PageChangedEvent { page:number; } +export const PAGINATION_CONTROL_VALUE_ACCESSOR: any = { + provide: NG_VALUE_ACCESSOR, + useExisting: forwardRef(() => PaginationComponent), + multi: true +}; + const PAGINATION_TEMPLATE = `