-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
Bug
What is the expected behavior?
Passing in a EventEmitter like:
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="itemSelected">
<mat-option *ngFor="let option of options" [value]="option.name">
<span>{{ option.name }}</span>
</mat-option>
</mat-autocomplete>
And my component:
itemSelected = new EventEmitter();
constructor () {
this.itemSelected.subscribe((item: any) => {
console.log(item);
})
}
To log the item that I clicked
What is the current behavior?
It's not logging anything when I click an option from the list.
It seems it's not triggering a .next on the eventEmitter.
I've also tried to do it with a new Subject, but to no avail.
I must be misunderstanding how this should work.
Metadata
Metadata
Assignees
Labels
No labels