0

What are http bindings actually used for in Angular2? Any working codes or plunker? In the doc it is not documented and says use HTTP Providers.

https://angular.io/docs/ts/latest/api/http/index/HTTP_BINDINGS-let.html

https://angular.io/docs/ts/latest/api/http/index/HTTP_PROVIDERS-let.html

Gary
  • 2,293
  • 2
  • 25
  • 47
  • Other than the bindings listed in the HTTP_Providers-let.html page? – Reza Jul 31 '16 at 06:09
  • 1
    [Check out the source](https://github.com/angular/angular/blob/2.0.0-rc.4/modules/%40angular/http/http.ts#L210). Doesn't look like it's good for anything, except leeching off providers :-). It looks like it's been this way since the first RC. Maybe it was used someway in the betas or even some time earlier (didn't check that far back). But it's deprecated now. I'm guessing part of that deprecation process was to just assign it to providers (where before deprecation, it probably has some other implementation) – Paul Samsotha Jul 31 '16 at 06:11
  • @peeskillet Is it deprecated? – Gary Jul 31 '16 at 06:14
  • @Reza - any code implementations of where you might use http bindings? – Gary Jul 31 '16 at 06:15
  • 1
    That's what the docs you linked to says (Stability: Deprecated), and the ngdocs in the code I linked to – Paul Samsotha Jul 31 '16 at 06:15
  • @peeskillet - ok yeah just saw. – Gary Jul 31 '16 at 06:17

1 Answers1

1

The difference between HTTP_BINDINGS and HTTP_PROVIDERS is the same as explained in https://stackoverflow.com/a/38682856/217408

HTTP_PROVIDERS are a set of services that you can inject to your custom services and components or directives to make HTTP calls like

constructor(http:Http) {
  http.get(someUrl).subscribe(...)
}
Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567