【发布时间】:2015-07-10 03:02:02
【问题描述】:
我们尝试使用 IBM Worklight 开发一个简单的 Angular 混合应用程序,并且希望在我们的应用程序中使用 JSONStore。根据 Worklight 文档,我们在 application-descriptor.xml 文件中的其他资源下添加了 JSONStore,并在代码中创建了简单集合,如下所示。
var data_collection = {
people : {
searchFields : {name: 'string', age: 'integer'}
}
};
var promise = WL.JSONStore.init(data_collection).then(function(){
alert("init json store successfully!");
return true;
}).fail(function (errorObject) {
alert("init json store failed!" + errorObject);
return false;
});
return promise;
};
但是这段代码对我们不起作用。它在 WL.JSONStore.init 方法本身失败。请在这方面帮助我们。
【问题讨论】:
-
提供日志查看异常情况。
-
除了提供日志之外的其他一个完整的sn-p你的代码。在您提供的 sn-p 中有一个额外的
}。看起来它是函数的一部分。另外,您在alert("init json store failed!" + errorObject);中遇到了什么错误 -
您对这个问题有任何更新吗?如果您能够解决您的问题,请将您的解决方案作为问题的答案发布。