Skip to content

Ng Generator does not save components in correct directory #6431

Closed
@iamclaytonray

Description

@iamclaytonray

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.3
node: 7.10.0
os: darwin x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.3
@angular/compiler-cli: 4.1.3

Repro steps.

ng new my-app
cd my-app/src/app && mkdir components
cd components
ng g component posts

Those are the only steps I took. I didn't touch the code. I just ran those commands. However, the posts component did not save under the components directory. They were saved in the app directory, even though I was in the components directory when running the generator. I am pretty new to Angular (first day) so I am not sure if that is the expected result or not. I wouldn't imagine that being the case, though.

The log given by the failure.

No logs.

Desired functionality.

The answer is for both questions. When you are in a specific directory and run ng g component component-name, the generated files should be a child of your current directory via the command line.

Mention any other details that might be useful.

Here's a screenshot of the file structure.
screen shot 2017-05-23 at 7 56 55 pm

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentseverity3: broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions