Skip to content

Shared folder isn't generated with component #1661

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
leogout opened this issue Aug 12, 2016 · 5 comments
Closed

Shared folder isn't generated with component #1661

leogout opened this issue Aug 12, 2016 · 5 comments

Comments

@leogout
Copy link

leogout commented Aug 12, 2016

  1. Ubuntu 14.04
  2. angular-cli: 1.0.0-beta.10
    node: 5.4.0
    os: linux x64
  3. I started a project with ng new myproject, then cd myproject and finally ng g component mycompo.
  4. No errors occured, this is the output :
installing component
  create src/app/mycompo/mycompo.component.css
  create src/app/mycompo/mycompo.component.html
  create src/app/mycompo/mycompo.component.spec.ts
  create src/app/mycompo/mycompo.component.ts
  create src/app/mycompo/index.ts

When i run tree :

>tree src/app/mycompo/
  src/app/mycompo/
  ├── index.ts
  ├── mycompo.component.css
  ├── mycompo.component.html
  ├── mycompo.component.spec.ts
  └── mycompo.component.ts

0 directories, 5 files

In my system-config.ts :

  ...
  // App specific barrels.
  'app',
  'app/shared',
  'app/mycompo',
  /** @cli-barrel */
];

As you can see, no app/mycompo/shared folder is created, and no app/mycompo/shared is added to system-config.ts (app/mycompo is added).

Hope I don't miss something, but as I saw in #1418, my shared folder should be here.

@ghost
Copy link

ghost commented Aug 12, 2016

Try adding --route to your component generation

I am using beta.11-webpack.2 and with ng generate component mycompo --route the app/mycompo/shared is generated. If I leave the --route parameter out - no shared folder

@leogout
Copy link
Author

leogout commented Aug 12, 2016

Ok that solved half of the problem, thanks ! But it still isn't added it to system-config.ts...

@filipesilva
Copy link
Contributor

#1658 removed barrels so this won't happen on the next release.

@gandra
Copy link

gandra commented Jan 14, 2017

I have the same issue with

angular-cli: 1.0.0-beta.25.5
node: 6.9.4
os: win32 x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/compiler-cli: 2.4.3

I am just starting to learn angular2 and angular-cli so I am not sure if this is intended behavior or bug?

@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 6, 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