通过链接提交代码了,不确定那个工具是否好用,在这里再贴一次代码
var Post = AV.Object.extend('Post');
var Comment = AV.Object.extend('Comment');
var p1 = AV.Object.createWithoutData('Post', '5652911460b215d6b04a8997');
p1.fetch({
include: 'comment'
}, {
success: function(p){
console.log('success callback: ' + p.get('comment').get('text'));
}
});
var p2 = AV.Object.createWithoutData('Post', '5652911460b215d6b04a8997');
p2.fetch({
include: 'comment'
}).then(function(p){
console.log('then callback: ' + p.get('comment').get('text'));
}
);
执行结果:
"then callback: undefined"
"success callback: 123434234235"