Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Angular 1 | Can I destroy a page manually?
rgins16 last edited by rgins16
I am using a navigator, and specifically the resetToPage() method. When I use this method, the ‘destroy’ event for the page does not fire. This is an issue for me when I navigate to the same page that I am already on. I would like for the page to completely reset, but it does not. The old DOM elements are still there. The page has not been destroyed.
Is this a bug? Should the destroy event be fired on resetToPage()?
I would greatly appreciate some clarification.
@rgins16 Sounds like a bug,
destroyevent should be fired right before a page is detached and
resetToPageshould remove all pages in the stack except one of them. Please report it on Github and we’ll have a look at it.
misterjunio Onsen UI last edited by
@rgins16 You are right about the missing event but in any case the DOM should be reloaded because the navigator is loading a totally new page on the stack (it doesn’t even check if it’s the same it’s in at that moment). Anyway we added the event throwing for the next release, thanks for pointing that out :+1:
rgins16 last edited by
Thanks guys. @misterjunio I had a check to see if a certain element existed on the page load. The very first time the page was loaded, the element did not exist yet. Then when I navigated to the same page, the element already existed. So the values on DOM refresh, but not the actual elements I guess.
@Fran-Diox did you still want me to create an issue on Github? It looks like @misterjunio has solved the issue already.