Angular2 中实际使用的 http 绑定是什么?任何工作代码或plunker?在文档中没有记录并说使用 HTTP 提供程序。
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
Angular2 中实际使用的 http 绑定是什么?任何工作代码或plunker?在文档中没有记录并说使用 HTTP 提供程序。
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
和之间的区别HTTP_BINDINGS
与https://stackoverflow.com/a/38682856/217408HTTP_PROVIDERS
中解释的相同
HTTP_PROVIDERS
是一组服务,您可以将其注入到您的自定义服务和组件或指令中,以进行 HTTP 调用,例如
constructor(http:Http) {
http.get(someUrl).subscribe(...)
}