One can subscribe to observables (don't forget to unsubscribe in ngOnDestroy) and get their values one by one, all at once, combined, reduced, transformed etc.
In angular templates use the async pipe to create ad hoc subscriptions: {{name$ | async}}
.
See examples.
Observables:
from(aPromise)
, from(rxAjax)
...Subjects:
BehaviorSubject
if you need access to the last emitted valueReplaySubject
if you need access to all the values (replayed)of(1, 2, 3)
= array-like listfrom([1, 2, 3])
from('abcdefg)
(a → b → c ... g)from(fetch('api/data'))
interval(1000)
fromEvent(document, 'click')
ajax('/api/data')
(import ajax from rxjs/ajax first)