I have a service, which first loads a config file from server through an $http call then in it's success call back I am reading the file content, which actually contains a list of files to load from the server.
So I make another call to server to load all other files. Is there any way in TypeScript to return a promise which will get called only when all the promises are get resolved. Same like $q.all we had in angular 1.X
I have a service, which first loads a config file from server through an $http call then in it's success call back I am reading the file content, which actually contains a list of files to load from the server.
So I make another call to server to load all other files. Is there any way in TypeScript to return a promise which will get called only when all the promises are get resolved. Same like $q.all we had in angular 1.X
Share Improve this question edited Dec 21, 2018 at 8:03 PG1 1,2422 gold badges12 silver badges27 bronze badges asked Jan 18, 2017 at 5:09 Pavan TiwariPavan Tiwari 3,1874 gold badges35 silver badges74 bronze badges 2- 1 Possible duplicate of q.all for angular2 observables – eko Commented Jan 18, 2017 at 5:11
- Possible duplicate of Angular 2 promise .all() with RxJS – seidme Commented Jan 18, 2017 at 5:23
1 Answer
Reset to default 8Promise.all([
//task1,
//task2,
//task3,
]).then((value) => {doSomething()});
task can be any Promise call