angular2-indexeddb
angular2-indexeddb copied to clipboard
Edge not allowing add method
I've been trying to use add() to insert into the DB but I get a [object DOMException]: {code:0, message:"DataError", name:"DataError"} exception every time its called.
I saw a previous issue that looks the same but is closed, it suggested adding in the key but that hasn't worked for me. This is happening with the current version of Edge on windows and on Windows Phone.
Yes. Even i am facing the same issue. Also in internet explorer.
@StudioKodeMike and @ashwinimendon,
How did you config the objectStore's key? Is it configured to autoIncrement (which isn't the default configuration)? If not, check the key configuration or the key type that you are passing to the add function.
Let me know if that solves your problem.
@gilf I'm not using autoincrement as the objects all have id's from the rest api I'm pulling them from.
I set the keyPath to whatever that it called in the api so that the objects can be organised the way they are in the backend.
By the time it get through Angular and into the database its a number taken from a JSON object.
This works fine in Chrome and Firefox but the update function throws an DataError in IE and Edge
DataService.db = new AngularIndexedDB('DB', 1); DataService.db.openDatabase(1, (evt) => { evt.currentTarget.result.createObjectStore( 'userTasks', { keyPath: 'id', autoIncrement: false }); })
DataService.db.update('userTasks', {id: 1, name: SomeTask, user: 123})
Same problem here :( A working example for Edge would be really great
Problem still persists on IE. I've tried the add method with and without the key parameter, but there's no way to have a value added to indexedDB. Does a working example exist somewhere?
We had this issue in IE11 and Edge. Installing the latest windows updates solved the issue (Windows 10).