Title: Generate service : providers registered in the wrong place if { provide } is present · Issue #7061 · angular/angular-cli · GitHub
Open Graph Title: Generate service : providers registered in the wrong place if { provide } is present · Issue #7061 · angular/angular-cli
X Title: Generate service : providers registered in the wrong place if { provide } is present · Issue #7061 · angular/angular-cli
Description: Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. cli 1.2.1 Repro steps. ng new test cd test ng g service hello Then in AppModule, provide it like th...
Open Graph Description: Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. cli 1.2.1 Repro steps. ng new test cd test ng g service hel...
X Description: Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. cli 1.2.1 Repro steps. ng new test cd test ng g service ...
Opengraph URL: https://github.com/angular/angular-cli/issues/7061
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generate service : providers registered in the wrong place if { provide } is present","articleBody":"### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [x] bug report -> please search issues before submitting\r\n- [ ] feature request\r\n```\r\n\r\n### Versions.\r\ncli 1.2.1\r\n\r\n### Repro steps.\r\n```\r\nng new test\r\ncd test\r\nng g service hello\r\n```\r\n\r\nThen in `AppModule`, provide it like this : \r\n\r\n```ts\r\n@NgModule({\r\n declarations: [\r\n AppComponent\r\n ],\r\n imports: [\r\n BrowserModule\r\n ],\r\n providers: [{ provide: HelloService, useClass: HelloService}],\r\n bootstrap: [AppComponent]\r\n})\r\n```\r\n\r\nNow, if you generate new services, with module registering option : \r\n\r\n```\r\nng g service world --module=app\r\n```\r\n\r\nIt produces : \r\n```ts\r\n@NgModule({\r\n declarations: [\r\n AppComponent\r\n ],\r\n imports: [\r\n BrowserModule\r\n ],\r\n providers: [{provide: HelloService, useClass: HelloService, providers: [WorldService]}],\r\n bootstrap: [AppComponent]\r\n})\r\n```","author":{"url":"https://github.com/cyrilletuzi","@type":"Person","name":"cyrilletuzi"},"datePublished":"2017-07-20T11:08:57Z","url":"https://github.com/angular/angular-cli/issues/7061"}
| 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:c56d6858-e7ea-ab45-abe6-1472ca9037c0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEAE:38EE04:17F90BA:1FA70D6:6B020988 |
| html-safe-nonce | 6e910988be032edbfecf01a42cc97e355ad81b849f35fd783af2407e14b94903 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUFFOjM4RUUwNDoxN0Y5MEJBOjFGQTcwRDY6NkIwMjA5ODgiLCJ2aXNpdG9yX2lkIjoiMjYwMTYyMDA5MTM3NjM3MjEwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d4dc13bee9df67b91fad405b167b7e2b21bade8eb964d0c695f4d0de5b936de5 |
| hovercard-subject-tag | issue:244325585 |
| 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-cli/7061/issue_layout |
| twitter:image | https://opengraph.githubassets.com/350a36c977cd74536e23c4b97587ff9231e123ac8484fefcc15c1772ac8803b1/angular/angular-cli/issues/7061 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/350a36c977cd74536e23c4b97587ff9231e123ac8484fefcc15c1772ac8803b1/angular/angular-cli/issues/7061 |
| og:image:alt | Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. cli 1.2.1 Repro steps. ng new test cd test ng g service hel... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cyrilletuzi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width