angular/packages/core/test/acceptance
Kristiyan Kostadinov 3aa45a2fa1 fix(core): resolve forward-referenced host directives during directive matching (#58492) (#58500)
When the compiler generates the `HostDirectivesFeature`, it generates either an eager call (`ɵɵHostDirectivesFeature([])`) or a lazy call (`ɵɵHostDirectivesFeature(() => [])`. The lazy call is necessary when there are forward references within the `hostDirectives` array. Currently we resolve the lazy variant when the component definition is created which has been enough for most cases, however if the host is injected by one of its host directives, we can run into a reference error because DI is synchronous and the host's class hasn't been defined yet.

These changes resolve the issue by pushing the lazy resolution later during directive matching when all classes are guanrateed to exist.

Fixes #58485.

PR Close #58492

PR Close #58500
2024-11-04 17:18:52 +01:00
..
authoring refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
after_render_hook_spec.ts fix(core): clean up afterRender after it is executed (#58119) 2024-10-08 13:27:07 -07:00
attributes_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
bootstrap_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
BUILD.bazel build: replace base64-js package with Node.js Buffer usage (#53464) 2023-12-11 14:04:06 -08:00
change_detection_signals_in_zones_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
change_detection_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
change_detection_transplanted_view_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
common_integration_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
component_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
content_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
control_flow_for_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
control_flow_if_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
control_flow_switch_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
copy_definition_feature_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
csp_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
defer_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
destroy_ref_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
di_forward_ref_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
di_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
directive_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
discover_utils_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
embedded_views_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
env_injector_standalone_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
environment_injector_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
exports_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
host_binding_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
host_directives_spec.ts fix(core): resolve forward-referenced host directives during directive matching (#58492) (#58500) 2024-11-04 17:18:52 +01:00
i18n_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
inherit_definition_feature_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
injector_profiler_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
integration_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
let_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
lifecycle_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
listener_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
local_compilation_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
ng_module_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
ngmodule_scope_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
outputs_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
pending_tasks_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
pipe_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
profiler_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
property_binding_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
property_interpolation_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
providers_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
pure_function_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
query_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
renderer_factory_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
router_integration_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
security_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
standalone_injector_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
standalone_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
styling_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
template_ref_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
text_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
view_container_ref_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
view_insertion_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
view_ref_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00