-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: componentProviders
failed on nested array providers
#506
Comments
Strictly speaking, even for (const provider of componentProviders.flat()) {
TestBed.overrideProvider(provide, provider);
} |
@timdeschryver How do you think the solution above; |
@lacolaco this is a case that we haven't thought of. Sided question: since standalone is the default, do you think it would be better to rename componentProviders to providers? And the existing providers to global/applicationProviders? |
@timdeschryver Yeah, I've created a PR. Please review it when you have time. |
The
providers
in the Angular framework always flatten all elements in the case of nested arrays of elements. In other words,Provider
can be an array of providers.https://angular.dev/api/core/Provider
However, due to recent changes, ATL no longer accepts nested arrays in
componentProviders
property. Previously,array.concat(provider)
had that role, but in the current implementation the step to flattencomponentProviders
is lost. This is a regresssion.061d5cc#diff-8e35d38d4ce658063a1f7522f82a938a8b99a52223927129ad8ddd28df541506L124
The text was updated successfully, but these errors were encountered: