From 8483615fedb3739102b6bcde97e1861d984fc1e1 Mon Sep 17 00:00:00 2001 From: Ignat Shining Date: Wed, 14 Sep 2016 16:34:42 +0300 Subject: [PATCH] fix(tests): "no provider" error when running tests (#963) --- components/datepicker/datepicker.component.ts | 3 ++- components/pagination/pager.component.ts | 3 ++- components/pagination/pagination.component.ts | 1 + components/rating/rating.component.ts | 3 ++- components/timepicker/timepicker.component.ts | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/components/datepicker/datepicker.component.ts b/components/datepicker/datepicker.component.ts index 68c675c76f..7f9e284d7f 100644 --- a/components/datepicker/datepicker.component.ts +++ b/components/datepicker/datepicker.component.ts @@ -31,7 +31,8 @@ import { ControlValueAccessor, NgModel } from '@angular/forms'; - ` + `, + providers: [NgModel] }) /* tslint:enable:component-selector-name component-selector-type */ export class DatePickerComponent implements ControlValueAccessor { diff --git a/components/pagination/pager.component.ts b/components/pagination/pager.component.ts index a00a75e3d8..b53828c6d0 100644 --- a/components/pagination/pager.component.ts +++ b/components/pagination/pager.component.ts @@ -24,7 +24,8 @@ const PAGER_TEMPLATE = ` /* tslint:disable */ @Component({ selector: 'pager[ngModel]', - template: PAGER_TEMPLATE + template: PAGER_TEMPLATE, + providers: [NgModel] }) /* tslint:enable */ export class PagerComponent extends PaginationComponent implements OnInit { diff --git a/components/pagination/pagination.component.ts b/components/pagination/pagination.component.ts index 74aa9ca3a3..74c11ac8f3 100644 --- a/components/pagination/pagination.component.ts +++ b/components/pagination/pagination.component.ts @@ -75,6 +75,7 @@ const PAGINATION_TEMPLATE = ` @Component({ selector: 'pagination[ngModel]', template: PAGINATION_TEMPLATE, + providers: [NgModel] }) /* tslint:enable */ export class PaginationComponent implements ControlValueAccessor, OnInit, PaginationConfig, KeyAttribute { diff --git a/components/rating/rating.component.ts b/components/rating/rating.component.ts index 4fce8b661e..3e26133f43 100644 --- a/components/rating/rating.component.ts +++ b/components/rating/rating.component.ts @@ -14,7 +14,8 @@ import { ControlValueAccessor, NgModel } from '@angular/forms'; - ` + `, + providers: [NgModel] }) export class RatingComponent implements ControlValueAccessor, OnInit { @Input() public max:number; diff --git a/components/timepicker/timepicker.component.ts b/components/timepicker/timepicker.component.ts index 51d0a526e4..74777c04c0 100644 --- a/components/timepicker/timepicker.component.ts +++ b/components/timepicker/timepicker.component.ts @@ -79,7 +79,8 @@ function addMinutes(date:any, minutes:number):Date { - ` + `, + providers: [NgModel] }) export class TimepickerComponent implements ControlValueAccessor, OnInit { public cd:NgModel;