With my code, I first check the status of word.statusId
to see if it's dirty. If it is, I update the word and then proceed to update wordForms. If it's clean, I simply update wordForms. I'm looking for advice on whether this is the correct approach for executing one promise after another.
update = (): ng.IPromise<any> => {
var self = this;
if (self.word.statusId != 3) {
return self.wordEditSubmit()
.then(() => {
return self.wordFormCheckAndUpdate();
})
} else {
return self.wordFormCheckAndUpdate();
}
}