From 9c9f290b029fc2105e475788f28b0d38e5b300e6 Mon Sep 17 00:00:00 2001 From: Marcel Jamin Date: Thu, 24 Mar 2016 12:42:08 +0100 Subject: [PATCH] fix(*): use synchronous event emitters as a workaround for dehydrated detector issues (see https://github.com/angular/angular/issues/6786) --- components/alert/alert.component.ts | 2 +- components/alert/readme.md | 2 +- components/datepicker/datepicker-inner.ts | 2 +- components/datepicker/datepicker-popup.ts | 2 +- components/dropdown/dropdown.directive.ts | 4 ++-- components/pagination/pagination.component.ts | 4 ++-- components/pagination/readme.md | 4 ++-- components/rating/rating.component.ts | 4 ++-- components/rating/readme.md | 4 ++-- components/tabs/readme.md | 6 +++--- components/tabs/tab.directive.ts | 6 +++--- components/typeahead/typeahead.directive.ts | 6 +++--- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/components/alert/alert.component.ts b/components/alert/alert.component.ts index 8d7bb3c884..a3579d0fd9 100644 --- a/components/alert/alert.component.ts +++ b/components/alert/alert.component.ts @@ -22,7 +22,7 @@ export class Alert implements OnInit { @Input() public dismissible:boolean; @Input() public dismissOnTimeout:number; - @Output() public close:EventEmitter = new EventEmitter(); + @Output() public close:EventEmitter = new EventEmitter(false); private closed:boolean; private classes:Array = []; diff --git a/components/alert/readme.md b/components/alert/readme.md index 22f6ed7ef0..db15331e1c 100644 --- a/components/alert/readme.md +++ b/components/alert/readme.md @@ -16,7 +16,7 @@ export class Alert implements OnInit { @Input() public dismissible:boolean; @Input() public dismissOnTimeout:number; - @Output() public close:EventEmitter = new EventEmitter(); + @Output() public close:EventEmitter = new EventEmitter(false); } ``` diff --git a/components/datepicker/datepicker-inner.ts b/components/datepicker/datepicker-inner.ts index 71e639a2cc..e017b552aa 100644 --- a/components/datepicker/datepicker-inner.ts +++ b/components/datepicker/datepicker-inner.ts @@ -105,7 +105,7 @@ export class DatePickerInner implements OnInit { private compareHandlerMonth:Function; private refreshViewHandlerYear:Function; private compareHandlerYear:Function; - private update:EventEmitter = new EventEmitter(); + private update:EventEmitter = new EventEmitter(false); @Input() private get initDate():Date { diff --git a/components/datepicker/datepicker-popup.ts b/components/datepicker/datepicker-popup.ts index b119c1005f..30f5e04a22 100644 --- a/components/datepicker/datepicker-popup.ts +++ b/components/datepicker/datepicker-popup.ts @@ -71,7 +71,7 @@ class PopupContainer { private display:string; private placement:string; private showButtonBar:boolean = true; - private update1:EventEmitter = new EventEmitter(); + private update1:EventEmitter = new EventEmitter(false); constructor(public element:ElementRef, options:PopupOptions) { Object.assign(this, options); diff --git a/components/dropdown/dropdown.directive.ts b/components/dropdown/dropdown.directive.ts index 3997c43246..1ae6c5cd77 100644 --- a/components/dropdown/dropdown.directive.ts +++ b/components/dropdown/dropdown.directive.ts @@ -19,8 +19,8 @@ export class Dropdown implements OnInit, OnDestroy { // enum string: ['always', 'outsideClick', 'disabled'] @Input() public appendToBody:boolean; - @Output() public onToggle:EventEmitter = new EventEmitter(); - @Output() public isOpenChange:EventEmitter = new EventEmitter(); + @Output() public onToggle:EventEmitter = new EventEmitter(false); + @Output() public isOpenChange:EventEmitter = new EventEmitter(false); @HostBinding('class.dropdown') private addClass = true; private _isOpen:boolean; diff --git a/components/pagination/pagination.component.ts b/components/pagination/pagination.component.ts index 1de7e55dc3..4bc390a151 100644 --- a/components/pagination/pagination.component.ts +++ b/components/pagination/pagination.component.ts @@ -87,8 +87,8 @@ export class Pagination implements ControlValueAccessor, OnInit, IPaginationConf @Input() private disabled:boolean; - @Output() private numPages:EventEmitter = new EventEmitter(); - @Output() private pageChanged:EventEmitter = new EventEmitter(); + @Output() private numPages:EventEmitter = new EventEmitter(false); + @Output() private pageChanged:EventEmitter = new EventEmitter(false); @Input() public get itemsPerPage() { return this._itemsPerPage; diff --git a/components/pagination/readme.md b/components/pagination/readme.md index a4e3116d1e..1208d5edf5 100644 --- a/components/pagination/readme.md +++ b/components/pagination/readme.md @@ -27,8 +27,8 @@ export class Pagination implements ControlValueAccessor, OnInit, IPaginationConf @Input() public get itemsPerPage():number {} @Input() private get totalItems():number {} - @Output() private numPages:EventEmitter = new EventEmitter(); - @Output() private pageChanged:EventEmitter = new EventEmitter(); + @Output() private numPages:EventEmitter = new EventEmitter(false); + @Output() private pageChanged:EventEmitter = new EventEmitter(false); @Component({ selector: 'pager[ngModel]', diff --git a/components/rating/rating.component.ts b/components/rating/rating.component.ts index a7ac9cb31b..110052950c 100644 --- a/components/rating/rating.component.ts +++ b/components/rating/rating.component.ts @@ -25,8 +25,8 @@ export class Rating implements ControlValueAccessor, OnInit { @Input() private titles:Array; @Input() private ratingStates:Array<{stateOn:string, stateOff:string}>; - @Output() private onHover:EventEmitter = new EventEmitter(); - @Output() private onLeave:EventEmitter = new EventEmitter(); + @Output() private onHover:EventEmitter = new EventEmitter(false); + @Output() private onLeave:EventEmitter = new EventEmitter(false); private range:Array; private value:number; diff --git a/components/rating/readme.md b/components/rating/readme.md index 54c5994cf2..eeeb1509db 100644 --- a/components/rating/readme.md +++ b/components/rating/readme.md @@ -18,8 +18,8 @@ export class Rating implements ControlValueAccessor, OnInit { @Input() private titles:Array; @Input() private ratingStates:Array<{stateOn:string, stateOff:string}>; - @Output() private onHover:EventEmitter = new EventEmitter(); - @Output() private onLeave:EventEmitter = new EventEmitter(); + @Output() private onHover:EventEmitter = new EventEmitter(false); + @Output() private onLeave:EventEmitter = new EventEmitter(false); } ``` diff --git a/components/tabs/readme.md b/components/tabs/readme.md index cc3798b23d..251edee615 100644 --- a/components/tabs/readme.md +++ b/components/tabs/readme.md @@ -37,9 +37,9 @@ export class Tab implements OnInit, OnDestroy, DoCheck { @HostBinding('class.active') @Input() public get active() {} - @Output() public select:EventEmitter = new EventEmitter(); - @Output() public deselect:EventEmitter = new EventEmitter(); - @Output() public removed:EventEmitter = new EventEmitter(); + @Output() public select:EventEmitter = new EventEmitter(false); + @Output() public deselect:EventEmitter = new EventEmitter(false); + @Output() public removed:EventEmitter = new EventEmitter(false); } // directive TabHeading diff --git a/components/tabs/tab.directive.ts b/components/tabs/tab.directive.ts index b7aacf2331..42ae015408 100644 --- a/components/tabs/tab.directive.ts +++ b/components/tabs/tab.directive.ts @@ -21,9 +21,9 @@ export class Tab implements OnDestroy { return this._active; } - @Output() public select:EventEmitter = new EventEmitter(); - @Output() public deselect:EventEmitter = new EventEmitter(); - @Output() public removed:EventEmitter = new EventEmitter(); + @Output() public select:EventEmitter = new EventEmitter(false); + @Output() public deselect:EventEmitter = new EventEmitter(false); + @Output() public removed:EventEmitter = new EventEmitter(false); public set active(active) { if (this.disabled && active || !active) { diff --git a/components/typeahead/typeahead.directive.ts b/components/typeahead/typeahead.directive.ts index 018add578e..50d6c53395 100644 --- a/components/typeahead/typeahead.directive.ts +++ b/components/typeahead/typeahead.directive.ts @@ -21,9 +21,9 @@ import {TypeaheadOptions} from './typeahead-options.class'; selector: 'typeahead[ngModel], [ngModel][typeahead]' }) export class Typeahead implements OnInit { - @Output() public typeaheadLoading:EventEmitter = new EventEmitter(); - @Output() public typeaheadNoResults:EventEmitter = new EventEmitter(); - @Output() public typeaheadOnSelect:EventEmitter<{item: any}> = new EventEmitter(); + @Output() public typeaheadLoading:EventEmitter = new EventEmitter(false); + @Output() public typeaheadNoResults:EventEmitter = new EventEmitter(false); + @Output() public typeaheadOnSelect:EventEmitter<{item: any}> = new EventEmitter(false); @Input() public typeahead:any; @Input() public typeaheadMinLength:number;