I'm trying to get a value of a changed element in a list, but I'm getting always value undefined while the property checked is right.
HTML
<div>
<mat-selection-list #costUnits
[(ngModel)]="selectedCostUnits"
(selectionChange)="onSelectionChange($event)"
>
<mat-list-option *ngFor="let label of labels" selected="true">
{{ label }}
</mat-list-option>
</mat-selection-list>
</div>
TS
onSelectionChange(event: MatSelectionListChange) {
console.log(event)
}
For example: I've clicked twice on one element in the list that was checked and got the following outputs.
