Closed
Description
🐞 bug report
Affected Package
The issue is caused by package @angular/common.
Is this a regression?
No.
Description
This is a request for clearer error messaging. When an NgSwitchDefault directive erroneously exists outside of a NgSwitch, the error message appears to be import-related, rather than a syntax error: No provider for NgSwitch found in NodeInjector...
🔬 Minimal Reproduction
- https://stackblitz.com/edit/angular-ivy-zexnwp?file=src/app/app.component.ts
- See console for error.
🔥 Exception or Error
ERROR Error: NG0201: No provider for NgSwitch found in NodeInjector
🌍 Your Environment
Angular Version:
any
Anything else relevant?