Angular-cli: ng generate to specific file path not working

Created on 13 Sep 2016  路  4Comments  路  Source: angular/angular-cli

OS?

OSX El Capitan (10.11.13)

Versions.

angular-cli: 1.0.0-beta.11-webpack.8
node: 6.2.0
os: darwin x64

Repro steps.

Trying to run ng g component mycomp\thiscomp as per the CLI Reference

ng g component <path/to/component-name>  

I have tried several permutations, but the path gets ignored and the generated output gets put into the root of the project.

For example

ng g component mycomp\thiscomp
installing component
  create src/app/mycompthiscomp/mycompthiscomp.component.css
  create src/app/mycompthiscomp/mycompthiscomp.component.html
  create src/app/mycompthiscomp/mycompthiscomp.component.spec.ts
  create src/app/mycompthiscomp/mycompthiscomp.component.ts

Thanks for checking this out !

Most helpful comment

my bad.

The issue is that I was using the wrong slash.

This will work:

ng g component mycomp/thiscomp

All 4 comments

my bad.

The issue is that I was using the wrong slash.

This will work:

ng g component mycomp/thiscomp

how to generate only one component file in angular, only one file
ex: name-parent.component.ts

@Anitha-Hexaware use command flags like --inline-template --inline-style etc

here is more info

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._

Was this page helpful?
0 / 5 - 0 ratings