on the result • Complex operations out of the box • Abort processing of data when you don’t need it (cancel) •Cons • More difficult to debug • Learning curve
13) { throw new Error('I don\'t like 13'); } return num; }) ).subscribe( num => console.log('Got num ' + num), err => console.log('Upssss...' + err)); map 1 1 13 X … … •When an error occurs the observable is cancelled and no data passes though
template-drive forms •Monitor changes by subscribing to one of the form control properties this.favoriteConference.valueChanges this.favoriteConference.statusChanges (valid / invalid) <input formControllName=“favoriteConference” ..>
new WebSocket(‘ws://localhost:8080/search-push'); source.addEventListener('message', event => observer.next(event)); } ); •Wrapping a WebSocket in an Observable