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

app.changePage -> activity.onHashChanged no params #31

Closed
tanwaniniranjan opened this issue Oct 28, 2015 · 3 comments
Closed

app.changePage -> activity.onHashChanged no params #31

tanwaniniranjan opened this issue Oct 28, 2015 · 3 comments

Comments

@tanwaniniranjan
Copy link

So, I am changing the page with - app.changePage("pagetwo", "prosciutto");
on the next page - activity.onHashChanged(function(pizza) { console.log(pizza); }); gives no data

in fact even on refreshing on this new hash, activity.onHashChanged(function(pizza) { console.log(pizza); }); gives no data.

More precise repro conditions: when the page is opened the first time, it wont work, but if I use the back button and then come back to this page, it does work.

@tanwaniniranjan
Copy link
Author

for now, a dirty fix is:

activity.onReady(function() {
app.changePage(window.location.hash.split("#!")[1].split("/")[0], window.location.hash.split("#!")[1].split("/")[1]);
});

@qathom
Copy link
Contributor

qathom commented Oct 28, 2015

Hi,

Thank you for reporting this error.
The problem: the page scope (activity callback) was called in the OnCreate callback, but since the release 1.0.2, the onHash callback is called before every page callbacks. So indeed, there was a "conflict".
I just fixed this, please let me know if it still doesn't work :)

@qathom qathom closed this as completed Oct 28, 2015
@tanwaniniranjan
Copy link
Author

That was quick!
And it worked like a charm! :)
Thank you!

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