-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Open
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimearea: devtoolscore: di
Milestone
Description
Is this a bug report or a feature request?
- Bug Report
- Feature Request
Please provide the steps to reproduce the issue [Bug Report only]
- Create a component with both
providers
andviewProviders
- Inspect the DI information in the "Injector Tree" tab in Angular DevTools
- Log different providers to the console
- The
value
entry is incorrect
Please provide the expected behavior vs the actual behavior you encountered [Bug Report only]
Should log different providers accurately.
Please provide a screenshot if possible [Bug Report only]
BComponent
:
@Component({
selector: 'app-b',
standalone: true,
imports: [CComponent],
providers: [
{
provide: Flower,
useValue: new Flower('🌺'),
},
],
viewProviders: [
{
provide: Flower,
useValue: new Flower('🌻'),
},
],
template: `
B (<code>@SkipSelf</code>): {{ flower.name }}
<br />
<app-c [prefix]="prefix" />
<ng-content></ng-content>
`,
})
export class BComponent {
// ...
}
Notice how the second log has a discrepancy between provider.useValue
and value:
Please provide the exception or error you saw [Bug Report only]
No response
Is this a browser-specific issue? If so, please specify the device, browser, and version. [Bug Report only]
No, I can reproduce it on both Firefox and Chrome.
Description [Feature Request only]
No response
Proposed solution [Feature Request only]
No response
Alternatives considered [Feature Request only]
No response
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimearea: devtoolscore: di