angular/packages/core/src/render3/features
Kristiyan Kostadinov 886cf6c452 fix(core): unable to inject viewProviders when host directive with providers is present
When registering providers, the DI system assumes that `viewProviders` are registered before plain `providers`. This was reinforced by components always being first in the array of directive matches, only one component being allowed per node and the fact that only components can have `viewProviders`.

This breaks down if there are host directives with `providers` on the component, because they'll execute earlier, throwing off the order of operations.

These changes fix the issue by separating out the resolvers for `viewProviders` and plain `providers` and explicitly running the component's `viewProviders` resolver before any others. This also has the benefit of not attempting to resolve `viewProviders` for directives which are guaranteed not to have them.

Fixes #65724.
2025-12-03 15:09:48 +01:00
..
external_styles_feature.ts docs: update license URL from angular.io to angular.dev and year of license to 2025 (#59407) 2025-01-09 10:27:54 -05:00
host_directives_feature.ts refactor(core): move more host directive matching logic into feature (#60452) 2025-03-19 19:10:14 +01:00
inherit_definition_feature.ts refactor(core): remove inputTransforms from definition (#59980) 2025-02-18 19:27:59 +00:00
ng_onchanges_feature.ts refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
providers_feature.ts fix(core): unable to inject viewProviders when host directive with providers is present 2025-12-03 15:09:48 +01:00