-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(material/schematics): AsyncPipe and NgIF not imported #28055
Conversation
@@ -26,7 +27,8 @@ import { map, shareReplay } from 'rxjs/operators'; | |||
MatButtonModule, | |||
MatSidenavModule, | |||
MatListModule, | |||
MatIconModule | |||
MatIconModule, | |||
CommonModule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should import the AsyncPipe
from @angular/common
, rather than the CommonModule
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But also the NgIf is used.
Should we add it or just use the CommonModule as usual?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do NgIf
since we don't need the entire module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code updated as discussed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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. |
When running
ng generate @angular/material:navigation navigation
, theasyncPipe
is used in the generated template but never imported into the Standalone Component imports.While the
AsyncPipe
should be imported to fix the issue, the*ngIf
is also used in the template (even though I think this disappears when the new control flow syntax adoption is finalized).The fix proposes to import the
CommonModule
as we usually do when working with Standalone Components.