Now in .then
section I all another promise http request:
.then(result => { this.service().then(data => {}); });
Is it a correct way to use chained promises?
Answer
Almost! You need to return the promise in the function, either like this:
.then(result => { return this.service().then(data => {}); });
or like this:
.then(result => this.service().then(data => {}));
No comments:
Post a Comment