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);
});
}
});
Asked
Active
Viewed 168 times
0

Arun Vinoth-Precog Tech - MVP
- 22,364
- 14
- 59
- 168

Mehak Fatima
- 263
- 1
- 4
1 Answers
0
Callback to RSVP.Promise accepts 2 arguments - resolve, and reject.
return new Ember.RSVP.Promise(function(resolve, reject) {
Ember.run(null, reject, obj);
});
Or, in ES2017 syntax:
return new Ember.RSVP.Promise((resolve, reject) => Ember.run(null, reject, obj));

Daniel Kmak
- 18,164
- 7
- 66
- 89
-
works like a charm, but i have this,message = self.get('i18n').t("login_page.inactive_fail"); in my controller which gives me an error (Cannot read property 'class' of undefined) in unit test, it would be extremely kind if you could tell me how to sort this out? – Mehak Fatima Aug 02 '17 at 06:07