var stubMyService=Ember.Object.extend({
//'authenticator:ooion( OAuth,username, password)
authenticate(OAuth2,username,password)
{
return new Ember.RSVP.Promise(function(reject){
Ember.run(null,reject,obj);
});
}
});
答案 0 :(得分:0)
回调到RSVP.Promise接受2个参数 - 解析并拒绝。
return new Ember.RSVP.Promise(function(resolve, reject) {
Ember.run(null, reject, obj);
});
或者,在ES2017语法中:
return new Ember.RSVP.Promise((resolve, reject) => Ember.run(null, reject, obj));