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

bi-directional data-binding not working with jqm panel #226

Open
asgeo1 opened this issue Sep 5, 2013 · 2 comments
Open

bi-directional data-binding not working with jqm panel #226

asgeo1 opened this issue Sep 5, 2013 · 2 comments

Comments

@asgeo1
Copy link

asgeo1 commented Sep 5, 2013

Hi @tigbro,

The docs say the data-opened attribute can be used for two-way data-binding for opening and closing a jqm panel.

It's true, it does work (in one direction at least) to open and close the panel when you change that property.

However, if the panel closes of it's own accord (e.g. swipe gesture), then the variable bound to data-opened is not updated, and is then out of sync with the state of the panel.

Have you noticed that?

I tried to create you a jsfiddle, but it doesn't initialise properly and doesn't run :( But you will get the gist.

http://jsfiddle.net/jKvwV/11/

thanks,
-adam

@tbosch
Copy link
Contributor

tbosch commented Sep 5, 2013

Hi,
this should work and I have tests for it!
Will look into this not until next week, sorry...

Tobias

Am 05.09.2013 um 00:19 schrieb Adam George [email protected]:

Hi @tigbro,

The docs say the data-opened attribute can be used for two-way data-binding for opening and closing a jqm panel.

It's true, it does work (in one direction at least) to open and close the panel when you change that property.

However, if the panel closes of it's own accord (e.g. swipe gesture), then the variable bound to data-opened is not updated, and is then out of sync with the state of the panel.

Have you noticed that?

I tried to create you a jsfiddle, but it doesn't initialise properly and doesn't run :( But you will get the gist.

http://jsfiddle.net/jKvwV/11/

thanks,
-adam


Reply to this email directly or view it on GitHub.

@asgeo1
Copy link
Author

asgeo1 commented Sep 6, 2013

Hi @tigbro,

I can see the issue now. I had attached my data-binding variable to $rootScope.

But it only works when it's attached to $scope. Not sure why that is - I thought $scope would have inherited from $rootScope.

AngularJS is a bit confusing :)

I did kind of want the data-binding variable on $rootScope though, as $rootScope is one way I can pass data/state between jqm pages.

I was trying to keep track of whether the panel was last in an opened/closed state as I moved to to/from the jqm page with the panel.

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

No branches or pull requests

2 participants