I am not sure of the difference between the following:
let errors = this.get('errors');
this.requestPermalink(this.get('title'), this.endpoint).then((resp) => {
// Do success stuff
}).catch((resp) => {
Ember.set(errors, 'permalink', "Test");
});
VS
this.requestPermalink(this.get('title'), this.endpoint).then((resp) => {
// Do success stuff
}).catch((resp) => {
let errors = this.get('errors');
Ember.set(errors, 'permalink', "Test");
});
The first one does not actually alter the errors
property. The error never shows up on the template. Whereas the second will and the resulting error shows up on my template.
I assume I am missing a key scoping issue with the promise.
Aucun commentaire:
Enregistrer un commentaire