我正在寻找一种在Durandal中使用Parse的方法。由于Parse是一个主干模块,因此它似乎应该进行某种修改。我对脊骨不熟悉,也找不到能帮助我的向导。我想使用作为通用Durandal (更准确地说是require.js)模块,如下所示:
define(['knockout', 'gmaps', 'durandal/composition'], function (ko, gmaps, composition) {
...
var latLng = new gmaps.LatLng(blah blah);
...
我试图使用Parse相似性,但没有运气:
define(['parse'], function(parse) {
console.log('Parse: ' + parse); //undefined
我在配置中添加了一个路径:
requirejs.config({
paths: {
'text': '../lib/require/text',
'async': '../lib/require/plugins/async',
'propertyParser': '../lib/require/plugins/propertyParser',
'goog': '../lib/require/plugins/goog',
'durandal': '../lib/durandal/js',
'plugins': '../lib/durandal/js/plugins',
'transitions': '../lib/durandal/js/transitions',
'bootstrap': '../lib/bootstrap/js/bootstrap',
'knockout': '../lib/knockout/knockout-2.3.0',
'parse': '../lib/parse/parse'
}
});
在SDK模块中,有很多代码,我不明白应该如何修改它,以便进一步使用Durandal。有人能解释一下吗?
我看到使用Parse JavaScript SDK是使用Parse BaaS的舒适方式,但是如果这个SDK不能为了我的目的而转换,那么用纯JS使用Parse是不是太难了?我是说没有SDK。
谢谢!
发布于 2014-07-07 01:10:23
你的配置似乎没问题,也许你的垫片不见了。谷歌的快速搜索带来了这个项目是main.js配置。
这是垫片部分:
parse: { deps: ['jquery', 'underscore'], exports: 'parse' }
希望这在任何方面都有帮助。
编辑:正如评论中提到的那样,Parse.com可能不是AMD的符合性。谷歌搜索过一点后,我发现了一个(github项目)[https://github.com/guillegette/amd-parse],这使得它符合AMD。我想这会帮到你的。
https://stackoverflow.com/questions/24594086
复制相似问题