With Observable it doesn't matter if you want to handle 0, 1, or multiple events. Often Observable is preferred over Promise because it provides the features of Promise and more. Note: There are Promise libraries out there that support cancellation, but ES6 Promise doesn't so far.Īn Observable is like a Stream (in many languages) and allows to pass zero or more events where the callback is called for each event. In what scenario can we use each case? Günter Zöchbauer answered, (686+ points)Ī Promise handles a single event when an async operation completes or fails. Difference between HTTP and HTTPClient in angular 4?Įnjoy! Angular - Promise vs Observable 551+ points ? 150,497+ viewedĬan someone please explain the difference between Promise and Observable in Angular?Īn example on each would be helpful in understanding both the cases.How to add font-awesome to Angular 2 + CLI project.Angular exception: Can’t bind to ‘ngFor’ since it isn’t a known native property.access key and value of object using *ngFor.How to add bootstrap to an angular-cli project.Delegation: EventEmitter or Observable in Angular. Angular 2 dynamic tabs with user-click chosen components.Angular2 Exception: Can’t bind to ‘routerLink’ since it isn’t a known native property.Angular - Use pipes in services and components.How to pass url arguments (query string) to a HTTP request on Angular.How to detect when an value changes in Angular?.Angular RC4 - Angular ^2.0.0 with Typescript 2.0.0.Angular: Can’t find Promise, Map, Set and Iterator.What are differences between SystemJS and Webpack?.How to detect a route change in Angular?.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |