-
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
Passing an argument to an aliased custom ng g
schematic, don't recognize the argument
#24518
Closed
1 task done
Labels
area: @angular/cli
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Comments
alan-agius4
added
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
labels
Jan 12, 2023
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this issue
Jan 13, 2023
…on name in `ng generate`. Previously, schematic aliases were not registered when a collection name was provided to `ng generate`. Example: `ng generate c` where `c` is an alias for `component` would work, but `ng generate @schematics/angular:c` would fail. This commits fixes the schematic registration to handle the latter case. Closes angular#24518
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this issue
Jan 13, 2023
…on name in `ng generate`. Previously, schematic aliases were not registered when a collection name was provided to `ng generate`. Example: `ng generate c` where `c` is an alias for `component` would work, but `ng generate @schematics/angular:c` would fail. This commits fixes the schematic registration to handle the latter case. Closes angular#24518
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this issue
Jan 13, 2023
…on name in `ng generate`. Previously, schematic aliases were not registered when a collection name was provided to `ng generate`. Example: `ng generate c` where `c` is an alias for `component` would work, but `ng generate @schematics/angular:c` would fail. This commits fixes the schematic registration to handle the latter case. Closes angular#24518
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this issue
Jan 13, 2023
…on name in `ng generate` Previously, schematic aliases were not registered when a collection name was provided to `ng generate`. Example: `ng generate c` where `c` is an alias for `component` would work, but `ng generate @schematics/angular:c` would fail. This commits fixes the schematic registration to handle the latter case. Closes angular#24518
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this issue
Jan 13, 2023
…on name in `ng generate` Previously, schematic aliases were not registered when a collection name was provided to `ng generate`. Example: `ng generate c` where `c` is an alias for `component` would work, but `ng generate @schematics/angular:c` would fail. This commits fixes the schematic registration to handle the latter case. Closes angular#24518
angular-robot bot
pushed a commit
that referenced
this issue
Jan 13, 2023
…on name in `ng generate` Previously, schematic aliases were not registered when a collection name was provided to `ng generate`. Example: `ng generate c` where `c` is an alias for `component` would work, but `ng generate @schematics/angular:c` would fail. This commits fixes the schematic registration to handle the latter case. Closes #24518
angular-robot bot
pushed a commit
that referenced
this issue
Jan 13, 2023
…on name in `ng generate` Previously, schematic aliases were not registered when a collection name was provided to `ng generate`. Example: `ng generate c` where `c` is an alias for `component` would work, but `ng generate @schematics/angular:c` would fail. This commits fixes the schematic registration to handle the latter case. Closes #24518 (cherry picked from commit 3ebb195)
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: @angular/cli
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Command
generate
Is this a regression?
The previous version in which this bug was not present was
13.x
Description
I've created a custom schematic, following the Authoring schematics
topic. The custom schematic (named
component
) has aliases (c
&comp
) and an argument (template
). Calling the schematic with an aliasng g custom-schematic:c template=grid
will throwUnknown argument: template grid
error. Callingng g custom-schematic:component template=grid
works fine.Minimal Reproduction
aliased-custom-schematic.zip
Open and unzip the attached sample. It consists of:
test-alias
custom schematic project, created following the Authoring schematicstopic. In addition, I have created
launch.json
file that will help you easily reproduce the problem.test-params
project, created withng new
command on which I'm calling the custom schematic, usingng g
. In addition, I have executednpm i ts-node
in order to be able to debug the custom schematic upon thetest-params
project.You can
npm i
on both projects.Open the
test-alias
project and change the paths in thelaunch.json
file, so that it uses your local paths.Go to Debug & Run tab in VSCode and run the
Run schematics:component
.Exception or Error
Your Environment
Anything else relevant?
When running the schematic, instead of debugging it, using the way it is described in the Authoring schematics
, it is working.
However when running it, instead of debugging through the
ng g test-alias:c --template=grid
it is still not working.The text was updated successfully, but these errors were encountered: