Remove CommonModule from Angular Component generation #31350
atennert
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Since a couple of versions, the contents of the Angular CommonModule are available as standalone. From my understanding. the imports of the standalone directives and pipes are to be preferred over importing CommonModule itself. And with the new template syntax for
@if
,@for
, ... we need it even less. Having signals, the async pipes are less often used as well.Suggestion: Remove CommonModule from the template here:
nx/packages/angular/src/generators/component/files/__fileName__.ts__tpl__
Line 7 in 9fd51ed
and here:
nx/packages/angular/src/generators/library/files/ng-module/src/lib/__libFileName__.module.ts__tpl__
Line 7 in 9fd51ed
as well as the imports in line 2.
Additional question, if CommonModule is to be removed from the template: shall the
import: []
stay there or be removed as well.Beta Was this translation helpful? Give feedback.
All reactions