In Angular 1.x I would sometimes need to make multiple http
requests and do something with all the responses. I would throw all the promises in an array and call Promise.all(promises).then(function (results) {...})
.
Angular 2 best practices seem to point towards the use of RxJS's Observable
as a replacement to promises in http
requests. If I have two or more different Observables created from http requests, is there an equivalent to Promise.all()
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…