5

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

PG1
  • 1,220
  • 2
  • 12
  • 27
Pavan Tiwari
  • 3,077
  • 3
  • 31
  • 71
  • 1
    Possible duplicate of [q.all for angular2 observables](http://stackoverflow.com/questions/37172093/q-all-for-angular2-observables) – eko Jan 18 '17 at 05:11
  • Possible duplicate of [Angular 2 promise .all() with RxJS](http://stackoverflow.com/questions/35247310/angular-2-promise-all-with-rxjs) – seidme Jan 18 '17 at 05:23

1 Answers1

7
Promise.all([
    //task1,
    //task2,
    //task3,
  ]).then((value) => {doSomething()});

task can be any Promise call

ani5ha
  • 386
  • 4
  • 7