javascript promises chaining code example
Example: how to implement a promise with daisy chaining in angular
private firstAction():Promise<any> {
return new Promise<any>(
(resolve, reject) => { ... }
);
}
private secondAction():Promise<any> {
return new Promise<any>(
(resolve, reject) => { ... }
);
}
execute() {
this.firstAction().then(
(firstResult:any) => this.secondAction().then(
(secondResult:any) => { ... }
);
)
}