Skip to content
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

Selected folder is ignored when generating Component, Directive etc. #37

Closed
probert94 opened this issue Feb 2, 2017 · 4 comments
Closed

Comments

@probert94
Copy link
Contributor

When I open the "New Angular2 Component" Wizard by right-clicking a folder inside my project, I would expect it to generate the Component inside the selected folder.
But at the moment, the corresponding "ng generate" command is always executed in the applications root.
That means, that every Component is automatically generated in the source-folder ("src") and added to the root-mdule ("AppModule").
I would expect the Component to be generated inside the selected folder and added to the nearest module, just as if "ng generate" was executed inside the selected folder.

It would also be cool to be able to browse the folder from the WizardPage, the selected folder (or application-root) should be the default value.

@probert94
Copy link
Contributor Author

@angelozerr We could simply execute the ng-command inside the selected folder, at least as long #34 isn't closed. What do you say?

@angelozerr
Copy link
Owner

@Springrbua to be honnest with you, I'm not a bix expert with angular-cli. It's difficult for me to give you some suggestion.

@probert94
Copy link
Contributor Author

@angelozerr Me neither :)
I didn't work with the angular-cli much until now, but i've seen, that executing the "ng generate" commands inside a sub-folder, adds the generated Angular part to the nearest module.
So if it's okay for you, I'll try to implement it as described above:

  • Add possibility to select folder for the Command-Execution (defaults to selected folder)
  • Execute the ng-command inside the selected folder

As soos as it's possible to select the module (see #32) we need to investigate, whether angular-cli preffers execution inside the root folder or inside the subfolders.

@probert94
Copy link
Contributor Author

@angelozerr I'll replace the project-selection (combobox) with folder-selection (Text with browse button).
Then I'll execute the command inside the selected folder.
The File(s) will not necessarily appear in the selected folder, but Angular-CLI will handle it correctly (for example add to nearest module).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants