Description
What is the expected behavior?
I want to call a function when an option is selected. After some search it seem that i have to use :
property optionSelections of MdAutocompleteTrigger
In the documentation : https://material.angular.io/components/component/autocomplete optionSelections Stream of autocomplete option selections.
I dont understand that , what is a stream, how to implement this ?
What is the current behavior?
Iam able to have MdAutocompleteTrigger In my component i add : @ViewChild(MdAutocompleteTrigger) trigger:MdAutocompleteTrigger; ngAfterContentInit() { setTimeout(() =>this.trigger.openPanel()); }
but i cannot use optionSelections, can someone can give me an example
I try this ngAfterContentInit() { setTimeout(() => Observable.merge(...this.trigger.optionSelections) .subscribe((option)=>console.log(option))); } but not working