angular/components

standalone missing: stackBlitz example page

Gopi7a opened this issue · 4 comments

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

I think we forgot to bump the versions for the pre-release. I'll reach out to the necessary folks to resolve this.

In the meantime, the 18.x docs seem to be working fine

Should be fixed now by angular/material.angular.io#1277.