From 589400c7a11f57bc2fab9afc130b8b0f034dd9f2 Mon Sep 17 00:00:00 2001 From: Jono Hill Date: Sat, 16 May 2015 12:15:52 +1200 Subject: [PATCH] Workaround for IE throwing InvalidAccessError on db open. --- src/angular-indexed-db.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/angular-indexed-db.coffee b/src/angular-indexed-db.coffee index ae87eae..d14f3c3 100644 --- a/src/angular-indexed-db.coffee +++ b/src/angular-indexed-db.coffee @@ -102,7 +102,8 @@ angular.module('indexedDB', []).provider '$indexedDB', -> createDatabaseConnection = -> deferred = $q.defer() - dbReq = indexedDB.open(dbName, dbVersion or 1) + # IE11 workaround - parseInt reminds IE that dbVersion is actually a number + dbReq = indexedDB.open(dbName, parseInt(dbVersion) or 1) dbReq.onsuccess = -> db = dbReq.result $rootScope.$apply ->