Skip to content

Commit

Permalink
refactor(autocomplete): merge optionSelections into single observable
Browse files Browse the repository at this point in the history
Merges the `optionSelections` into a single observable, in order to make it easier to consume.

Fixes angular#3205.
  • Loading branch information
crisbeto committed Feb 20, 2017
1 parent b939cd8 commit ebcc2cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/autocomplete/autocomplete-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ export class MdAutocompleteTrigger implements AfterContentInit, ControlValueAcce
*/
get panelClosingActions(): Observable<MdOptionSelectEvent> {
return Observable.merge(
...this.optionSelections,
this.optionSelections,
this._blurStream.asObservable(),
this._keyManager.tabOut
);
}

/** Stream of autocomplete option selections. */
get optionSelections(): Observable<MdOptionSelectEvent>[] {
return this.autocomplete.options.map(option => option.onSelect);
get optionSelections(): Observable<MdOptionSelectEvent> {
return Observable.merge(...this.autocomplete.options.map(option => option.onSelect));
}

/** The currently active option, coerced to MdOption type. */
Expand Down

0 comments on commit ebcc2cf

Please sign in to comment.