Angular 1 | Can I destroy a page manually?
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.
@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
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.