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);
});
}
});
回调回复。承诺接受 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));