-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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(expansion-panel): allow two-way binding on 'expanded' property #9311
Labels
feature
This issue represents a new feature or feature request rather than a bug or bug fix
help wanted
The team would appreciate a PR from the community to address this issue
P4
A relatively minor issue that is not relevant to core functions
Comments
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 10, 2018
Supports two-way binding to the `expanded` property on the expansion panel. Fixes angular#9311.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 10, 2018
* Supports two-way binding to the `expanded` property on the expansion panel. * Fixes som wrong indentation in the tests. Fixes angular#9311.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 10, 2018
* Supports two-way binding to the `expanded` property on the expansion panel. * Fixes som wrong indentation in the tests. Fixes angular#9311.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 10, 2018
* Supports two-way binding to the `expanded` property on the expansion panel. * Fixes som wrong indentation in the tests. Fixes angular#9311.
jelbourn
pushed a commit
that referenced
this issue
Jan 21, 2018
* Supports two-way binding to the `expanded` property on the expansion panel. * Fixes som wrong indentation in the tests. Fixes #9311.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 22, 2018
* Supports two-way binding to the `expanded` property on the expansion panel. * Fixes som wrong indentation in the tests. Fixes angular#9311.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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
help wanted
The team would appreciate a PR from the community to address this issue
P4
A relatively minor issue that is not relevant to core functions
Bug, feature request, or proposal:
feature
What is the expected behavior?
allow two way binding on panel's expanded property
What is the current behavior?
Currently, 'expanded' is only an Input
What is the use-case or motivation for changing an existing behavior?
Right now, when we try to open/close panel programatically, we usually do something like:
<mat-expansion-panel [expanded]="isExpanded" (opened)="setExpanded(true)" (closed)="setExpanded(false)">
We cannot just set the model's property and rely on Angular's change detection to update the view because when a user interact with the UI, the expanded property value does not update on model's isExpanded property. We will need to bind opened and closed to update model to keep them in sync.
It would be nice and neat if we can somehow do this:
<mat-expansion-panel [(expanded)]="isExpanded">
then in the model file, we can just work on the isExpanded property without worrying that it might be out of sync with the view.
The text was updated successfully, but these errors were encountered: