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

Implement the canonical isOpenChange event to allow two-way binding on isOpen #167

Merged

Conversation

rluba
Copy link
Contributor

@rluba rluba commented Feb 10, 2016

This allows two-way bindings like <… dropdown [(isOpen)]="my.isOpen"> to prevent the internal and external flags from going out-of-sync whenever the dropdown is closed automatically.

From the angular2 documentation:

[…] Angular matches [(x)] to an x input property for property binding and an xChange output property for event binding.

This is a full replacement for the onToggle event but you might want to keep it around for backwards compatibility reasons.

@valorkin
Copy link
Member

Nice one, same as with fix for #124
please update commit message, so I can generate change logs later

- Implement the canonical `isOpenChange` event to allow two-way binding
- Update documentation example to use the new two-way binding

This allows bindings like `<… dropdown [(isOpen)]="my.isOpen">` to prevent the internal and external flags from going out-of-sync whenever the dropdown is closed automatically.

From the angular2 documentation:
> […] Angular matches [(x)] to an x input property for property binding and an xChange output property for event binding.
@rluba rluba force-pushed the feature/isOpen_two_way_binding branch from e7ab684 to 674fcb7 Compare February 10, 2016 15:03
@rluba
Copy link
Contributor Author

rluba commented Feb 10, 2016

Here you go. I’ve also updated the documentation

valorkin added a commit that referenced this pull request Feb 10, 2016
Implement the canonical `isOpenChange` event to allow two-way binding on `isOpen`
@valorkin valorkin merged commit 8e92309 into valor-software:master Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants