refactor(autocomplete): merge optionSelections into single observable (#3212)

Merges the `optionSelections` into a single observable, in order to make it easier to consume.

Fixes #3205.
This commit is contained in:
Kristiyan Kostadinov
2017-02-21 22:44:42 +01:00
committed by mmalerba
parent ceb472bab6
commit e3b2486c4b
+3 -3
View File
@@ -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. */