Question

I have run into some problems with using durandaljs as a framework for html5 mobile apps, I have never had to deal with this on a web application.

Whenever there is any kind of error, durandaljs pretty much packs up, the router stops working etc. It's not always my code as sometimes error handling doesn't solve the problem. I use phonegap and very often phonegap gets temperamental and calls to plugins may fail or crash or something equally inexplicable. When this happens, the only way around it is to shutdown the app and start it up again.

My users have a very short fuse and asking them to shutdown the app and log back in every time a bug rears up would definitely ensure the app does not make it past the pilot phase. What I want is to be able to have a button that the user can click and it would restart durandaljs as if the app were starting up for the first time.

My question is, is there a way to restart durandaljs when this happens without shutting down the app and starting it up again; I know AngularJS allows something like this.

Thanks

Was it helpful?

Solution

I found a pretty easy way to do this. Simply call

location.reload
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top