Question

I wish to use indexeddb in my angularjs app. However loading indexeddb and setting op the stores is async; and my route's resolve method already starts querying the db for data on page load.

As the db isn't set up yet, the query fails.

What is the best way to handle this?

Is there a way in angularjs to wait for my indexeddb to load before starting the app?

Was it helpful?

Solution

You could do manual bootstrap of your modules instead of angular doing it. I suppose indexeddb has a way to intimate when it's done loading.. In that callback, you could bootstrap angular. Refer http://docs.angularjs.org/guide/bootstrap for manual initialization.

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