-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Component not generated in specified directory. #1639
Comments
@Brocco can you have a look? |
I believe this is a product of the move of the @Phatsuo can you please verify your app's angular-cli.json configuration? |
AFAIK, I am just using the default configuration.
I tried changing is as you seem to suggest:
That resulted in an error.
|
I see - related to #1633. |
OK, #1633 is closed, and as of Beta 15, this is still an issue, even with a brand new project. My angular-cli.json:
I have discovered a workaround. The following commands do allow the creation of new entities in the directory of choice. Perhaps just the documentation is incorrect at this point.
The only slight problem being in app.module.ts the path ends up as (note the backslash after 'components'):
and it has to be changed to:
|
You should be defining the path to your components with the appropriate path separator:
so in your case @Phatsuo instead of: Closing this issue as I believe all is working, if not comment here and we can re-open and investigate further. |
I am on Windows, but using GitBash. This appears to be part of the problem. Sorry I did not specify that before. As of Beta 17, I have retested - everything works as documented from a DOS prompt. From GitBash, specifying the path with a forward slash now works properly.
But the original problem I reported in this issue is still present - when generating from a subdirectory, the subdirectory is ignored. (again works fine from DOS, just not from GitBash).
|
`process.env.PWD` is different between gitbash and cmd - gitbash: `D:/sandbox/master-project/src/app/other` - cmd: `D:\sandbox\master-project\src\app\other` Normalizing it via `path.normalize` solves the problem. Fix angular#1639
`process.env.PWD` is different between gitbash and cmd - gitbash: `D:/sandbox/master-project/src/app/other` - cmd: `D:\sandbox\master-project\src\app\other` Normalizing it via `path.normalize` solves the problem. Fix #1639
Same with cygwin - annoying... |
`process.env.PWD` is different between gitbash and cmd - gitbash: `D:/sandbox/master-project/src/app/other` - cmd: `D:\sandbox\master-project\src\app\other` Normalizing it via `path.normalize` solves the problem. Fix angular#1639
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Windows 10
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:angular-cli: 1.0.0-beta.11-webpack.2
node: 5.10.1
os: win32 x64
do on your code? etc.
change to a directory, for example, /app/components, then run
ng g component new-component
more information.
installing component
create src\app\new-component\new-component.component.css
create src\app\new-component\new-component.component.html
create src\app\new-component\new-component.component.spec.ts
create src\app\new-component\new-component.component.ts
create src\app\new-component\index.ts
create src\app\new-component\shared\index.ts
The documentation states:
"# if in the directory src/app/feature/ and you run"
ng g component new-cmp
"# your component will be generated in src/app/feature/new-cmp"
so the results should have been this:
installing component
create src\app\components\new-component\new-component.component.css
create src\app\components\new-component\new-component.component.html
create src\app\components\new-component\new-component.component.spec.ts
create src\app\components\new-component\new-component.component.ts
create src\app\components\new-component\index.ts
create src\app\components\new-component\shared\index.ts
The text was updated successfully, but these errors were encountered: