Skip to content

Commit

Permalink
fix(*): use synchronous event emitters as a workaround for dehydrated…
Browse files Browse the repository at this point in the history
… detector issues (see angular/angular#6786)
  • Loading branch information
Marcel Jamin committed Mar 24, 2016
1 parent 80b73b4 commit 9c9f290
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion components/alert/alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class Alert implements OnInit {
@Input() public dismissible:boolean;
@Input() public dismissOnTimeout:number;

@Output() public close:EventEmitter<Alert> = new EventEmitter();
@Output() public close:EventEmitter<Alert> = new EventEmitter(false);

private closed:boolean;
private classes:Array<string> = [];
Expand Down
2 changes: 1 addition & 1 deletion components/alert/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Alert implements OnInit {
@Input() public dismissible:boolean;
@Input() public dismissOnTimeout:number;

@Output() public close:EventEmitter<Alert> = new EventEmitter();
@Output() public close:EventEmitter<Alert> = new EventEmitter(false);
}
```

Expand Down
2 changes: 1 addition & 1 deletion components/datepicker/datepicker-inner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class DatePickerInner implements OnInit {
private compareHandlerMonth:Function;
private refreshViewHandlerYear:Function;
private compareHandlerYear:Function;
private update:EventEmitter<Date> = new EventEmitter();
private update:EventEmitter<Date> = new EventEmitter(false);

@Input()
private get initDate():Date {
Expand Down
2 changes: 1 addition & 1 deletion components/datepicker/datepicker-popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class PopupContainer {
private display:string;
private placement:string;
private showButtonBar:boolean = true;
private update1:EventEmitter<any> = new EventEmitter();
private update1:EventEmitter<any> = new EventEmitter(false);

constructor(public element:ElementRef, options:PopupOptions) {
Object.assign(this, options);
Expand Down
4 changes: 2 additions & 2 deletions components/dropdown/dropdown.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class Dropdown implements OnInit, OnDestroy {
// enum string: ['always', 'outsideClick', 'disabled']
@Input() public appendToBody:boolean;

@Output() public onToggle:EventEmitter<boolean> = new EventEmitter();
@Output() public isOpenChange:EventEmitter<boolean> = new EventEmitter();
@Output() public onToggle:EventEmitter<boolean> = new EventEmitter(false);
@Output() public isOpenChange:EventEmitter<boolean> = new EventEmitter(false);
@HostBinding('class.dropdown') private addClass = true;

private _isOpen:boolean;
Expand Down
4 changes: 2 additions & 2 deletions components/pagination/pagination.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export class Pagination implements ControlValueAccessor, OnInit, IPaginationConf

@Input() private disabled:boolean;

@Output() private numPages:EventEmitter<number> = new EventEmitter();
@Output() private pageChanged:EventEmitter<IPageChangedEvent> = new EventEmitter();
@Output() private numPages:EventEmitter<number> = new EventEmitter(false);
@Output() private pageChanged:EventEmitter<IPageChangedEvent> = new EventEmitter(false);

@Input() public get itemsPerPage() {
return this._itemsPerPage;
Expand Down
4 changes: 2 additions & 2 deletions components/pagination/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<number> = new EventEmitter();
@Output() private pageChanged:EventEmitter<IPageChangedEvent> = new EventEmitter();
@Output() private numPages:EventEmitter<number> = new EventEmitter(false);
@Output() private pageChanged:EventEmitter<IPageChangedEvent> = new EventEmitter(false);

@Component({
selector: 'pager[ngModel]',
Expand Down
4 changes: 2 additions & 2 deletions components/rating/rating.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class Rating implements ControlValueAccessor, OnInit {
@Input() private titles:Array<string>;
@Input() private ratingStates:Array<{stateOn:string, stateOff:string}>;

@Output() private onHover:EventEmitter<number> = new EventEmitter();
@Output() private onLeave:EventEmitter<number> = new EventEmitter();
@Output() private onHover:EventEmitter<number> = new EventEmitter(false);
@Output() private onLeave:EventEmitter<number> = new EventEmitter(false);

private range:Array<any>;
private value:number;
Expand Down
4 changes: 2 additions & 2 deletions components/rating/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export class Rating implements ControlValueAccessor, OnInit {
@Input() private titles:Array<string>;
@Input() private ratingStates:Array<{stateOn:string, stateOff:string}>;

@Output() private onHover:EventEmitter<number> = new EventEmitter();
@Output() private onLeave:EventEmitter<number> = new EventEmitter();
@Output() private onHover:EventEmitter<number> = new EventEmitter(false);
@Output() private onLeave:EventEmitter<number> = new EventEmitter(false);
}
```

Expand Down
6 changes: 3 additions & 3 deletions components/tabs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export class Tab implements OnInit, OnDestroy, DoCheck {
@HostBinding('class.active')
@Input() public get active() {}

@Output() public select:EventEmitter<Tab> = new EventEmitter();
@Output() public deselect:EventEmitter<Tab> = new EventEmitter();
@Output() public removed:EventEmitter<Tab> = new EventEmitter();
@Output() public select:EventEmitter<Tab> = new EventEmitter(false);
@Output() public deselect:EventEmitter<Tab> = new EventEmitter(false);
@Output() public removed:EventEmitter<Tab> = new EventEmitter(false);
}

// directive TabHeading
Expand Down
6 changes: 3 additions & 3 deletions components/tabs/tab.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export class Tab implements OnDestroy {
return this._active;
}

@Output() public select:EventEmitter<Tab> = new EventEmitter();
@Output() public deselect:EventEmitter<Tab> = new EventEmitter();
@Output() public removed:EventEmitter<Tab> = new EventEmitter();
@Output() public select:EventEmitter<Tab> = new EventEmitter(false);
@Output() public deselect:EventEmitter<Tab> = new EventEmitter(false);
@Output() public removed:EventEmitter<Tab> = new EventEmitter(false);

public set active(active) {
if (this.disabled && active || !active) {
Expand Down
6 changes: 3 additions & 3 deletions components/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import {TypeaheadOptions} from './typeahead-options.class';
selector: 'typeahead[ngModel], [ngModel][typeahead]'
})
export class Typeahead implements OnInit {
@Output() public typeaheadLoading:EventEmitter<boolean> = new EventEmitter();
@Output() public typeaheadNoResults:EventEmitter<boolean> = new EventEmitter();
@Output() public typeaheadOnSelect:EventEmitter<{item: any}> = new EventEmitter();
@Output() public typeaheadLoading:EventEmitter<boolean> = new EventEmitter(false);
@Output() public typeaheadNoResults:EventEmitter<boolean> = new EventEmitter(false);
@Output() public typeaheadOnSelect:EventEmitter<{item: any}> = new EventEmitter(false);

@Input() public typeahead:any;
@Input() public typeaheadMinLength:number;
Expand Down

0 comments on commit 9c9f290

Please sign in to comment.