According to materials documentation optionselected emits an event.
Mat autocomplete select event.
The event selectionchange is used with mat select element as following.
Angular material select provides selectionchange event that emits when the selected value has been changed by the user.
One with isuserinput true and one with false.
Now it s possible to recognize when the item is selected or deselected.
I am using an autocomplete mat autocomplete and at the moment it allows loading a list of users.
Using mat autocomplete of material2.
Bug feature request or proposal.
I tried optionselected foofn but it doesn t exist.
If you want to toggle mat select autocomplete from your own component event you need to import multiselectcomponent in the component and take it s reference as viewchild element eg.
Both will fire soap request and the last soap request is the previous selected value isuserinput false.
The onselectionchange event replaced the selected event.
If you want to integrate material autocomplete functionality in angular 6 7 8 this tutorial will work with every version.
This allfruits val map user user username.
In autocomplete i want to display the username but i want to save the value of that chosen user id.
I know that value stores the selected object offer in my case.
Now it s possible to recognize when the item is selected or deselected.
If i have a selected value and change the value the onselectionchange will fire two events.