Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tvde1 opened this issue Jul 6, 2021 · 2 comments · Fixed by #23125
Closed

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

Tvde1 opened this issue Jul 6, 2021 · 2 comments · Fixed by #23125
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@Tvde1
Copy link

Tvde1 commented Jul 6, 2021

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.

@Tvde1 Tvde1 added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels Jul 6, 2021
@crisbeto crisbeto self-assigned this Jul 7, 2021
@crisbeto crisbeto added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Jul 7, 2021
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 7, 2021
Adds support for two-way data binding on the `selected` property of `mat-list-option`.

Fixes angular#23122.
wagnermaciel pushed a commit that referenced this issue Jul 9, 2021
…#23125)

Adds support for two-way data binding on the `selected` property of `mat-list-option`.

Fixes #23122.
@Tvde1
Copy link
Author

Tvde1 commented Jul 9, 2021

I really appreciate this, you guys are amazing! ❤️

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants