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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top