Sunday, September 2, 2018

Why promises have been dropped for the http service in Angular 2+?

I know that in Angular everything revolves around observables but I don't really get why they are supposedly better than promises when it comes to the http services.



For websockets it makes sense cause the flow of data is continuous bidirectional but for calling RESTful services with AJAX behind the scenes I am not really sure what are the benefits, especially when to do just one shot call (e.g. GET) in the ngOnInit?



And since the http services is mostly for doing calls to web services and I guess primarily not for websockets, I don't really get the gist, it's not overkill?



https://angular.io/guide/comparing-observables

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...