Skip to content

'new g service name --module=my.module' not adding a service in a right place #7322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kuncevic opened this issue Aug 10, 2017 · 3 comments
Closed

Comments

@kuncevic
Copy link

kuncevic commented Aug 10, 2017

Bug Report

- [ x] bug report
- [ ] feature request

Versions.

@angular/cli: 1.3.0-rc.5
node: 7.8.0
os: win32 x64
@angular/animations: 4.3.3
@angular/common: 4.3.3
@angular/compiler: 4.3.3
@angular/core: 4.3.3
@angular/flex-layout: 2.0.0-rc.1
@angular/forms: 4.3.3
@angular/http: 4.3.3
@angular/material: 2.0.0-beta.3
@angular/platform-browser: 4.3.3
@angular/platform-browser-dynamic: 4.3.3
@angular/router: 4.3.3
@angular/cli: 1.3.0-rc.5
@angular/compiler-cli: 4.1.3

Repro steps.

  1. Have a module with providers (in my case it is core.module) e.g:
providers: [
    Guards.LoggedInGuard,
    Services.AuthService,
    // more services here
    [{provide: ErrorHandler, useClass: GlobalErrorHandler}],
  ],
  1. Run
    ng g service core/services/super --module=core.module

In result CLI sticks the SuperService in to providers array like:

providers: [
    Guards.LoggedInGuard,
    Services.AuthService,
    // more services here
    [{provide: ErrorHandler, useClass: GlobalErrorHandler}SuperService],
  ],

Desired functionality.

The ng g service core/services/super --module=core.module result should be

providers: [
    Guards.LoggedInGuard,
    Services.AuthService,
    // more services here
    [{provide: ErrorHandler, useClass: GlobalErrorHandler}],
    SuperService
  ],
@cyrilletuzi
Copy link
Contributor

Same as #7061

@Brocco
Copy link
Contributor

Brocco commented Aug 18, 2017

Closing in favor of #7061

@Brocco Brocco closed this as completed Aug 18, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants