-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workarounddocsThis issue is related to documentationThis issue is related to documentation
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Once we click the stackBlitz link from the Angular Material page, showing error like "error NG2010: 'imports' is only valid on a component that is standalone."
All the sample code in the stackBlitz missing standalone: true in @component decorator.
Checked version 18+
Angular Material team, need to fix it.
Reproduction
StackBlitz link: https://stackblitz.com/run?file=.gitignore
Steps to reproduce:
- Go to Angular Material page
- Select any components like Stepper, SideNav
- Go To Example tab, open any of the StackBlitz link from example.
- After loading the module, you will get an error like "error NG2010: 'imports' is only valid on a component that is standalone."
To fix it,
need to add standalone: true in @component decorator.
Expected Behavior
Add the standalone: true in @component decorator and should run the example code in StackBlitz without an error.
Actual Behavior
After loading the module in StackBlitz example, you will get an error like "error NG2010: 'imports' is only valid on a component that is standalone."
Environment
- Angular: 18+
- CDK/Material: Angular Material StackBlitz
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): MacOs
Metadata
Metadata
Assignees
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workarounddocsThis issue is related to documentationThis issue is related to documentation