ORIGINAL EXCEPTION: Attempt to use a destroyed view: detectchanges

Hi I have this error that occurs after RESUBMITTING a form. First submit, I dont enter anything, so the validation fails. second submit, I have this error. What may be the cause of this error? Please, help

I have got the same error, but I call the “LoadingController” before send and dismiss that after service callback. Without loader controller everything work fine, I suppose the loader don’t performs a detach …

1 Like

I think I know why.

I had a global this.loading = this.loadingCtrl.create(…) set up in my init method on the controller.
But it seems that when you dismiss the control, it actually gets destroyed.

To resolve it, re-create it before you re-present it (after if has been dismissed).

This fix works for me for now.


@superkew i am facing the same error can you please share your solution please so it can also help others.


it solves that problem of “Attempt to use destroyed View” one. but the view still don’t get dismissed which is written like this.viewController.dismiss() after this.loader.dismiss(). the temporary solution i found is to wrote this.viewController.dismiss() twice… plz reply if someone find some better solution for it.

use ViewConstroller.dismiss() twice after coming back from http request and hiding loader icon. it should work for now