Title: Dependency injection doesn't load all dependencies in a custom backend · Issue #9758 · angular/angular · GitHub
Open Graph Title: Dependency injection doesn't load all dependencies in a custom backend · Issue #9758 · angular/angular
X Title: Dependency injection doesn't load all dependencies in a custom backend · Issue #9758 · angular/angular
Description: I'm submitting a ... (check one with "x") [X] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question Current be...
Open Graph Description: I'm submitting a ... (check one with "x") [X] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/ma...
X Description: I'm submitting a ... (check one with "x") [X] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angula...
Opengraph URL: https://github.com/angular/angular/issues/9758
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dependency injection doesn't load all dependencies in a custom backend","articleBody":"**I'm submitting a ...** (check one with \"x\")\n\n```\n[X] bug report\n[ ] feature request\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n```\n\n**Current behavior**\n\nI'm currently trying to create a custom XHRBackend for my angular2 app. I want to catch all http responses with a 401 http response code (unauthorized) to redirect the user on the login-page. But here comes my problem: the dependency Injection is not able to load the Router in my custom-backend. I also tried to inject some services, but this also did not work. It only injects the 3 dependencies of the XHRBackend in my custom one. \n\nI asked this in SO and the only solution was to use a factory to create my custom backend, but I think this should also work the way i tried. [Stackoverflow post](http://stackoverflow.com/questions/38124321/dependency-injection-does-not-load-all-params/38124520?noredirect=1#comment63680845_38124520) \n\n**Expected/desired behavior**\n\nIt should be possible to use the dependency injection in a custom backend to inject additional dependencies. \n\n**Reproduction of the problem**\n\nhttp://plnkr.co/edit/44imf9KpE06cIyQ395sg?p=preview\n\nAs you can see, the router inside the CustomXHRBackend is undefined.\n\n**Please tell us about your environment:**\n- **Angular version:** 2.0.0-rc.3\n- **Browser:** all\n- **Language:** TypeScript 1.8.10\n","author":{"url":"https://github.com/Dinistro","@type":"Person","name":"Dinistro"},"datePublished":"2016-07-01T06:02:07Z","url":"https://github.com/angular/angular/issues/9758"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:99b20ec5-4158-aa13-5fd7-357f56dff729 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D2F8:23CF06:96A2CF:C3DAB1:6B00E002 |
| html-safe-nonce | f4b4089c3ec80ecd9183921eec728d56fe7646eda492ba77430119d820909f77 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkY4OjIzQ0YwNjo5NkEyQ0Y6QzNEQUIxOjZCMDBFMDAyIiwidmlzaXRvcl9pZCI6IjI4Nzg3MjIxOTQzNzkxNjk3OTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4b1a20cd394b53d3511180deadf5a1e2dfd767107bb8216ba99b27c922ad3500 |
| hovercard-subject-tag | issue:163325249 |
| 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/9758/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a542c63a729b023285f8270818eced83c74d63d49ca02c1a5762afda5480058f/angular/angular/issues/9758 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a542c63a729b023285f8270818eced83c74d63d49ca02c1a5762afda5480058f/angular/angular/issues/9758 |
| og:image:alt | I'm submitting a ... (check one with "x") [X] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/ma... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Dinistro |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width