Skip to content

standalone missing: stackBlitz example page #29896

@Gopi7a

Description

@Gopi7a

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:

  1. Go to Angular Material page
  2. Select any components like Stepper, SideNav
  3. Go To Example tab, open any of the StackBlitz link from example.
  4. 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 workarounddocsThis issue is related to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions