You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Angular-CLI beta 25, the "generate" command lets you specify a module (see angular/angular-cli#3811)
The generate Wizards could support this to (using a Combobox with available modules?).
The nearest module could be selected by default.
The text was updated successfully, but these errors were encountered:
I just tested how this works and it seems like you must specify the path to the module file.
For example: ng generate directive test --module ../app.module.ts
This allowes you to create a file in any directory and instead of declaring it in the nearest module, you can declare it in any module.
I have tested following cases:
Specify a non-existing file -> Command fails, no files generated/changed
Specify a file without @NgModule annotation -> Files are generated, but not added to any module
Specify a file with more then one @NgModule annotation -> Files generated and declaration added to last @NgModule in specified file
@angelozerr I guess this feature won't be needed verry often, as you usually want declarations to go into the nearest @NgModule.
But if we want to support this, a basic support with a file-chooser could be implemented pretty fast and would be enough for now.
Later we could extend it to show only files, which contain at least 1 @NgModule-annotation.
Since Angular-CLI beta 25, the "generate" command lets you specify a module (see angular/angular-cli#3811)
The generate Wizards could support this to (using a Combobox with available modules?).
The nearest module could be selected by default.
The text was updated successfully, but these errors were encountered: