Working version:
const observable = Observable
.from([Promise.resolve('1'), Promise.resolve('2')])
.subscribe((results) => {})
Broken version (added mergeAll
operator):
const observable = Observable
.from([Promise.resolve('1'), Promise.resolve('2')])
.mergeAll()
.subscribe((results) => {})
Propery 'subscribe' doesn't exist on type 'Promise<{string}>'
I'm using the basic Angular CLI
setup.
What might be the reason?
Whenever you are returning the resolving the promise. You should be using fromPromise operator as below
Also try logging the results as in the code.