2014-12-18 29 views
1

是否有可能在IndexedDB中使用angular-localForage有多个dataStore?是否可以在angular-localForage中创建多个dataStore?

我尝试这样做:

var $tblStage = $localForage.createInstance({ 
    storeName : 'tblStage', // name of the table 
}); 

但它触发它说的错误:

Error: A localForage instance with the name dbName is already defined.

我以前读this Question但是,是唯一的出路正在与原始IndexedDB的?或者我错过了我的代码中的东西?任何想法?

回答

0

是的,只有在您使用时进行配置。 https://github.com/mozilla/localForage#configuration

但是在同一个分贝上没有可能的两个实例。

如果您打算使用指令local-forage,则必须复制并配置它。

就像这样https://github.com/ocombe/angular-localForage/blob/master/src/angular-localForage.js#L51,为了改变提供, 只改变#L20的defaultConfig和角度模块指令#L465的名称。

并提供更多的信息,但声誉非常低,这留下钩和我的英语如此糟糕。

相关问题