Repository navigation
fix(@schematics/angular): use the generated class name when declaring in an NgModule - #34448
Conversation
… in an NgModule With `addTypeToClassName: false`, the component and directive schematics name the class without the type, but the NgModule declaration was added with the type appended (e.g. `FooComponent`), so the module no longer compiled. Honour `addTypeToClassName` when computing the declared symbol. Fixes angular#34447
There was a problem hiding this comment.
Code Review
This pull request adds support for generating component and directive class names without their type suffix when addTypeToClassName is set to false. This is implemented by updating the DeclarationToNgModuleOptions interface and the addDeclarationToNgModule utility, and is verified with new unit tests. Feedback on the changes points out a bug in the new component schematic test where the assertion expects App instead of AppComponent in the module declarations, which will cause the test to fail.
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
With
addTypeToClassName: false, the component and directive schematics name the class withoutthe type, but the NgModule declaration was added with the type appended (e.g.
FooComponent),so the module no longer compiled.
Honour
addTypeToClassNamewhen computing the declared symbol.Fixes #34447