Comments (3)
You are trying to run two async operations in parallel and ending up with that error.
In order to correct your code you will have to run the second open in the then function of the first open call.
this.database.openDatabase(3,
(evt) => {
console.log("version 3");
this.database.openDatabase(2, ...)
}(error) => {
console.log(error);
}
)
from angular2-indexeddb.
Okay, I tried it. It works, when I already have a version 3 database in my browser.
But when I have a version 0, 1 or 2 it failes, when I try to open it in an older version. So in your example "version 3" would be printed to the console and then I got an error.
Thanks for your help.
I resolved it with just opening it once with the current version and then doing a switch on the evt.oldVersion.
this.database.openDatabase(3, (evt) => {
switch (evt.oldVersion) {
case 0: this.version0(evt);
case 1: this.version1(evt);
case 2: this.version2(evt);
case 3: this.version3(evt);
}
It is a bit dirty but It works for now.
from angular2-indexeddb.
Thanks for letting me know.
I'm closing this issue and if I'll have any fix, I'll comment here.
from angular2-indexeddb.
Related Issues (20)
- "Module build failed" withAngular 5 HOT 5
- Using Injectable with mandatory primitive type constructor parameters HOT 1
- Angular 5 Can't resolve all parameters for AngularIndexedDB HOT 5
- Error While Loading the Application HOT 1
- README.md may not be up to date HOT 1
- Not working in IE edge HOT 4
- Cannot find name 'IDBCursorDirection' HOT 1
- Edge not allowing add method HOT 7
- I just canβt get the add to work in edge
- 5659:15-36 Critical dependency: the request of a dependency is an expression HOT 1
- Cannot build application with angular2-indexeddb - angular2-indexeddb.ts' is not under 'rootDir' HOT 1
- can't resolve all parameters for angularindexeddb HOT 2
- can not create store with exsisting db HOT 3
- openDatabase error from the second time
- Error when using with Angular 6.0 HOT 7
- Property 'value' does not exist on type 'IDBDatabase'. angular 7.0 HOT 11
- Some functions resolve before they are complete
- Unable to build
- GetByIndex returning Undefined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2-indexeddb.