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
Page lifecycle events #833
Conversation
It looks good to me. Great work! |
@anatoo @argelius I added angular directives for the events. I'm not sure if this is the way you wanted it.
Also like this There was a "destroy" directive registered in some components, but I think we were not firing any "destroy" event before. I used that one for page's destroy. We need Japanese translation in |
This changes will merge in #896. |
Page Lifecycle Events
This PR allows ons-pages to throw lifecycle events even if they are appended to nested components (tabbar -> navigator -> page).
ons-page
automatically in order to have the same API and make it homogeneous. The only exception is when the component is the main element (<body><ons-navigator> ... </ons_navigator></body>
)._hide()
,_show()
and_destroy()
.ons-page
will throwshow
andhide
when showing or hiding. This also happens after its creation, if immediately shown, and before its deletion, if it was displayed at that moment.ons-sliding-menu
that contains anons-navigator
as the main page will throwhide
event only for the displayed page butdestroy
event for every page in navigator's page stack._muted
attribute for this.ons-sliding-menu
andons-split-view
cannot implement this API since they are not WebComponents yet. This has been amended in L102. The only minor drawback is that menu-pages will also throw events.ons-fab
would also use this API to hide and show the button.