Title: refactor(Http): remove HttpFactory · Issue #2564 · angular/angular · GitHub
Open Graph Title: refactor(Http): remove HttpFactory · Issue #2564 · angular/angular
X Title: refactor(Http): remove HttpFactory · Issue #2564 · angular/angular
Description: There are two things that can be injected in order to perform Http requests, Http or HttpFactory. Http is a class with the primary method of request, plus some shortcut methods like get, post, etc. HttpFactory is a function equivalent to...
Open Graph Description: There are two things that can be injected in order to perform Http requests, Http or HttpFactory. Http is a class with the primary method of request, plus some shortcut methods like get, post, etc....
X Description: There are two things that can be injected in order to perform Http requests, Http or HttpFactory. Http is a class with the primary method of request, plus some shortcut methods like get, post, etc....
Opengraph URL: https://github.com/angular/angular/issues/2564
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"refactor(Http): remove HttpFactory","articleBody":"There are two things that can be injected in order to perform Http requests, `Http` or `HttpFactory`. Http is a class with the primary method of `request`, plus some shortcut methods like `get`, `post`, etc. `HttpFactory` is a function equivalent to `Http.request`. \n\nI think having `HttpFactory` adds more concepts/complexity than is warranted, and I'd like to remove it. For one, it requires two more pages of documentation. One page to document the factory itself, and another to document the `IHttp` interface that exists solely to provide type information for the factory.\n\n``` js\n// Factory\nimport {HttpFactory, IHttp} from 'angular2/http';\nclass MyComponent {\n constructor(@Inject(HttpFactory) http:IHttp) {\n http('angular.json').subscribe(ng =\u003e this.angular = ng);\n }\n}\n\n// Class\nimport {Http} from 'angular2/http';\nclass MyComponent {\n constructor(http:Http) {\n http.request('angular.json').subscribe(ng =\u003e this.angular = ng);\n }\n}\n```\n\nThe idea of having a simple callable function instead of calling a class method is nice, but I think the trade-off of additional concepts isn't worth the overhead.\n\n@blesh @caitp what do you two think?\n","author":{"url":"https://github.com/jeffbcross","@type":"Person","name":"jeffbcross"},"datePublished":"2015-06-16T16:02:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/2564/angular/issues/2564"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9eece34b-993e-4b81-ead1-153b40311eda |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A7B6:3F83A1:AE1024:E8EFEE:6A600F86 |
| html-safe-nonce | 42a5dc38854a2ec8ed90cae62557a83ae1a4a1284f00d352b8b6c25ad029a330 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0I2OjNGODNBMTpBRTEwMjQ6RThFRkVFOjZBNjAwRjg2IiwidmlzaXRvcl9pZCI6IjIwNjE1NDc3MTA3NDMzMTg0MDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6eec501ea3680487938255aac002b2d1050f4cee1f977839044ec5063f037a4f |
| hovercard-subject-tag | issue:88768739 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/2564/issue_layout |
| twitter:image | https://opengraph.githubassets.com/160caaeb749a7e864bdbaf7612b2f26e77160195e3cbdd78e1d3c75d120748c4/angular/angular/issues/2564 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/160caaeb749a7e864bdbaf7612b2f26e77160195e3cbdd78e1d3c75d120748c4/angular/angular/issues/2564 |
| og:image:alt | There are two things that can be injected in order to perform Http requests, Http or HttpFactory. Http is a class with the primary method of request, plus some shortcut methods like get, post, etc.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jeffbcross |
| hostname | github.com |
| expected-hostname | github.com |
| None | 48cb2ed2304f8ae5a4a05d6327faf70466c4c0d9dcbf7b9df76251ca9c669a90 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cb0f10a384099e0765239a7cc220992cae52bdba |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width