Skip to content

feat(mat-list-option): 2-way value data binding. #23122

@Tvde1

Description

@Tvde1

Feature Description

The mat-list-option currently has an @Input selected: boolean which is bound to the checkbox' selected status.
I would like that (de)selecting can also change the boolean in my typescript like follows:

<mat-selection-list>
    <mat-list-option [(selected)]="isChecked">Check me!</mat-list-option>
</mat-selection-list>

Is my option checked? {{ isChecked }}!

Use Case

This would allow me to bind the selected status to a boolean of the model I have bound to my component, instead of accessing the selection list. Because I have references to the models, from my main component.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions