@angular/core 7.2.0-beta.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/core-testing.umd.js +194 -128
- package/bundles/core-testing.umd.js.map +1 -1
- package/bundles/core-testing.umd.min.js +10 -10
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +5582 -4512
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +122 -129
- package/bundles/core.umd.min.js.map +1 -1
- package/core.d.ts +12 -12
- package/core.metadata.json +1 -1
- package/esm2015/core.externs.js +45 -35
- package/esm2015/core.js +12 -13
- package/esm2015/index.js +3 -4
- package/esm2015/public_api.js +3 -5
- package/esm2015/src/application_init.js +22 -10
- package/esm2015/src/application_module.js +6 -5
- package/esm2015/src/application_ref.js +94 -37
- package/esm2015/src/application_tokens.js +21 -16
- package/esm2015/src/change_detection/change_detection.js +8 -7
- package/esm2015/src/change_detection/change_detection_util.js +2 -4
- package/esm2015/src/change_detection/change_detector_ref.js +2 -3
- package/esm2015/src/change_detection/constants.js +30 -32
- package/esm2015/src/change_detection/differs/default_iterable_differ.js +108 -29
- package/esm2015/src/change_detection/differs/default_keyvalue_differ.js +53 -16
- package/esm2015/src/change_detection/differs/iterable_differs.js +100 -90
- package/esm2015/src/change_detection/differs/keyvalue_differs.js +85 -73
- package/esm2015/src/change_detection/pipe_transform.js +10 -5
- package/esm2015/src/change_detection.js +7 -3
- package/esm2015/src/codegen_private_exports.js +2 -3
- package/esm2015/src/console.js +3 -3
- package/esm2015/src/core.js +3 -4
- package/esm2015/src/core_private_export.js +2 -3
- package/esm2015/src/core_render3_private_export.js +13 -7
- package/esm2015/src/debug/debug_node.js +132 -90
- package/esm2015/src/di/defs.js +59 -50
- package/esm2015/src/di/forward_ref.js +5 -6
- package/esm2015/src/di/injectable.js +11 -11
- package/esm2015/src/di/injection_token.js +10 -6
- package/esm2015/src/di/injector.js +53 -43
- package/esm2015/src/di/injector_compatibility.js +13 -12
- package/esm2015/src/di/metadata.js +22 -13
- package/esm2015/src/di/provider.js +137 -120
- package/esm2015/src/di/r3_injector.js +127 -57
- package/esm2015/src/di/reflective_errors.js +19 -13
- package/esm2015/src/di/reflective_injector.js +20 -16
- package/esm2015/src/di/reflective_key.js +7 -5
- package/esm2015/src/di/reflective_provider.js +21 -20
- package/esm2015/src/di/scope.js +5 -5
- package/esm2015/src/di/util.js +13 -14
- package/esm2015/src/di.js +2 -3
- package/esm2015/src/error_handler.js +5 -4
- package/esm2015/src/errors.js +7 -8
- package/esm2015/src/event_emitter.js +3 -3
- package/esm2015/src/i18n/tokens.js +12 -10
- package/esm2015/src/is_dev_mode.js +2 -3
- package/esm2015/src/ivy_switch.js +2 -3
- package/esm2015/src/linker/compiler.js +9 -12
- package/esm2015/src/linker/component_factory.js +2 -3
- package/esm2015/src/linker/component_factory_resolver.js +24 -10
- package/esm2015/src/linker/element_ref.js +5 -3
- package/esm2015/src/linker/ng_module_factory.js +6 -5
- package/esm2015/src/linker/ng_module_factory_loader.js +63 -16
- package/esm2015/src/linker/query_list.js +16 -14
- package/esm2015/src/linker/system_js_ng_module_factory_loader.js +12 -5
- package/esm2015/src/linker/template_ref.js +2 -3
- package/esm2015/src/linker/view_container_ref.js +2 -3
- package/esm2015/src/linker/view_ref.js +13 -7
- package/esm2015/src/linker.js +3 -3
- package/esm2015/src/metadata/di.js +22 -15
- package/esm2015/src/metadata/directives.js +33 -19
- package/esm2015/src/metadata/lifecycle_hooks.js +81 -66
- package/esm2015/src/metadata/ng_module.js +82 -68
- package/esm2015/src/metadata/resource_loading.js +4 -3
- package/esm2015/src/metadata/view.js +25 -26
- package/esm2015/src/metadata.js +6 -3
- package/esm2015/src/platform_core_providers.js +5 -5
- package/esm2015/src/profile/profile.js +17 -13
- package/esm2015/src/profile/wtf_impl.js +36 -16
- package/esm2015/src/r3_symbols.js +18 -5
- package/esm2015/src/reflection/platform_reflection_capabilities.js +81 -40
- package/esm2015/src/reflection/reflection.js +5 -5
- package/esm2015/src/reflection/reflection_capabilities.js +38 -27
- package/esm2015/src/reflection/reflector.js +2 -3
- package/esm2015/src/reflection/types.js +2 -12
- package/esm2015/src/render/api.js +67 -47
- package/esm2015/src/render.js +3 -3
- package/esm2015/src/render3/assert.js +38 -3
- package/esm2015/src/render3/bindings.js +111 -0
- package/esm2015/src/render3/component.js +88 -77
- package/esm2015/src/render3/component_ref.js +86 -56
- package/esm2015/src/render3/context_discovery.js +94 -92
- package/esm2015/src/render3/definition.js +58 -51
- package/esm2015/src/render3/di.js +206 -166
- package/esm2015/src/render3/di_setup.js +51 -31
- package/esm2015/src/render3/discovery_utils.js +225 -39
- package/esm2015/src/render3/empty.js +28 -0
- package/esm2015/src/render3/errors.js +11 -15
- package/esm2015/src/render3/features/inherit_definition_feature.js +13 -10
- package/esm2015/src/render3/features/ng_onchanges_feature.js +15 -12
- package/esm2015/src/render3/features/providers_feature.js +2 -3
- package/esm2015/src/render3/fields.js +5 -5
- package/esm2015/src/render3/global_utils.js +22 -7
- package/esm2015/src/render3/global_utils_api.js +13 -7
- package/esm2015/src/render3/hooks.js +21 -26
- package/esm2015/src/render3/i18n.js +134 -115
- package/esm2015/src/render3/index.js +15 -7
- package/esm2015/src/render3/instructions.js +938 -813
- package/esm2015/src/render3/interfaces/container.js +37 -6
- package/esm2015/src/render3/interfaces/context.js +39 -37
- package/esm2015/src/render3/interfaces/definition.js +225 -265
- package/esm2015/src/render3/interfaces/i18n.js +179 -151
- package/esm2015/src/render3/interfaces/injector.js +95 -13
- package/esm2015/src/render3/interfaces/node.js +413 -382
- package/esm2015/src/render3/interfaces/player.js +78 -37
- package/esm2015/src/render3/interfaces/projection.js +5 -10
- package/esm2015/src/render3/interfaces/query.js +66 -60
- package/esm2015/src/render3/interfaces/renderer.js +292 -117
- package/esm2015/src/render3/interfaces/sanitization.js +2 -6
- package/esm2015/src/render3/interfaces/styling.js +322 -111
- package/esm2015/src/render3/interfaces/view.js +356 -298
- package/esm2015/src/render3/jit/compiler_facade.js +10 -4
- package/esm2015/src/render3/jit/compiler_facade_interface.js +195 -152
- package/esm2015/src/render3/jit/directive.js +26 -16
- package/esm2015/src/render3/jit/environment.js +8 -5
- package/esm2015/src/render3/jit/injectable.js +7 -10
- package/esm2015/src/render3/jit/module.js +309 -25
- package/esm2015/src/render3/jit/pipe.js +2 -3
- package/esm2015/src/render3/jit/util.js +2 -3
- package/esm2015/src/render3/metadata.js +11 -10
- package/esm2015/src/render3/ng_dev_mode.js +5 -6
- package/esm2015/src/render3/ng_module_ref.js +48 -22
- package/esm2015/src/render3/node_assert.js +2 -3
- package/esm2015/src/render3/node_manipulation.js +137 -117
- package/esm2015/src/render3/node_selector_matcher.js +46 -19
- package/esm2015/src/render3/pipe.js +36 -21
- package/esm2015/src/render3/players.js +17 -12
- package/esm2015/src/render3/pure_function.js +86 -39
- package/esm2015/src/render3/query.js +93 -80
- package/esm2015/src/render3/state.js +88 -203
- package/esm2015/src/render3/styling/class_and_style_bindings.js +963 -249
- package/esm2015/src/render3/styling/core_player_handler.js +6 -4
- package/esm2015/src/render3/styling/player_factory.js +3 -4
- package/esm2015/src/render3/styling/util.js +69 -31
- package/esm2015/src/render3/tokens.js +7 -6
- package/esm2015/src/render3/util.js +65 -55
- package/esm2015/src/render3/view_engine_compatibility.js +36 -59
- package/esm2015/src/render3/view_engine_compatibility_prebound.js +2 -3
- package/esm2015/src/render3/view_ref.js +58 -44
- package/esm2015/src/sanitization/bypass.js +29 -6
- package/esm2015/src/sanitization/html_sanitizer.js +48 -16
- package/esm2015/src/sanitization/inert_body.js +33 -18
- package/esm2015/src/sanitization/sanitization.js +35 -25
- package/esm2015/src/sanitization/security.js +3 -4
- package/esm2015/src/sanitization/style_sanitizer.js +10 -7
- package/esm2015/src/sanitization/url_sanitizer.js +9 -7
- package/esm2015/src/testability/testability.js +72 -42
- package/esm2015/src/type.js +6 -8
- package/esm2015/src/util/decorators.js +19 -14
- package/esm2015/src/util/lang.js +2 -3
- package/esm2015/src/util/ng_reflect.js +2 -3
- package/esm2015/src/util/noop.js +2 -3
- package/esm2015/src/util/property.js +3 -4
- package/esm2015/src/util.js +12 -4
- package/esm2015/src/version.js +6 -6
- package/esm2015/src/view/element.js +17 -17
- package/esm2015/src/view/entrypoint.js +15 -5
- package/esm2015/src/view/errors.js +4 -5
- package/esm2015/src/view/index.js +2 -3
- package/esm2015/src/view/ng_content.js +3 -4
- package/esm2015/src/view/ng_module.js +2 -3
- package/esm2015/src/view/provider.js +89 -24
- package/esm2015/src/view/pure_expression.js +14 -15
- package/esm2015/src/view/query.js +14 -14
- package/esm2015/src/view/refs.js +96 -38
- package/esm2015/src/view/services.js +64 -37
- package/esm2015/src/view/text.js +5 -6
- package/esm2015/src/view/types.js +390 -325
- package/esm2015/src/view/util.js +29 -24
- package/esm2015/src/view/view.js +43 -36
- package/esm2015/src/view/view_attach.js +9 -10
- package/esm2015/src/zone/ng_zone.js +29 -28
- package/esm2015/src/zone.js +3 -3
- package/esm2015/testing/index.js +2 -3
- package/esm2015/testing/public_api.js +4 -4
- package/esm2015/testing/src/async.js +2 -3
- package/esm2015/testing/src/async_fallback.js +8 -7
- package/esm2015/testing/src/async_test_completer.js +14 -6
- package/esm2015/testing/src/before_each.js +10 -4
- package/esm2015/testing/src/component_fixture.js +48 -17
- package/esm2015/testing/src/fake_async.js +9 -3
- package/esm2015/testing/src/fake_async_fallback.js +5 -5
- package/esm2015/testing/src/lang_utils.js +3 -4
- package/esm2015/testing/src/logger.js +2 -3
- package/esm2015/testing/src/metadata_override.js +2 -6
- package/esm2015/testing/src/metadata_overrider.js +9 -8
- package/esm2015/testing/src/ng_zone_mock.js +2 -3
- package/esm2015/testing/src/private_export_testing.js +2 -3
- package/esm2015/testing/src/r3_test_bed.js +324 -174
- package/esm2015/testing/src/resolvers.js +28 -11
- package/esm2015/testing/src/test_bed.js +123 -54
- package/esm2015/testing/src/test_bed_common.js +142 -85
- package/esm2015/testing/src/test_compiler.js +2 -3
- package/esm2015/testing/src/testing.js +3 -3
- package/esm2015/testing/src/testing_internal.js +17 -12
- package/esm2015/testing/testing.js +1 -2
- package/esm5/core.js +12 -13
- package/esm5/index.js +1 -2
- package/esm5/public_api.js +1 -2
- package/esm5/src/application_init.js +1 -2
- package/esm5/src/application_module.js +1 -2
- package/esm5/src/application_ref.js +1 -2
- package/esm5/src/application_tokens.js +1 -2
- package/esm5/src/change_detection/change_detection.js +1 -2
- package/esm5/src/change_detection/change_detection_util.js +1 -2
- package/esm5/src/change_detection/change_detector_ref.js +1 -2
- package/esm5/src/change_detection/constants.js +3 -4
- package/esm5/src/change_detection/differs/default_iterable_differ.js +1 -2
- package/esm5/src/change_detection/differs/default_keyvalue_differ.js +1 -2
- package/esm5/src/change_detection/differs/iterable_differs.js +1 -2
- package/esm5/src/change_detection/differs/keyvalue_differs.js +1 -2
- package/esm5/src/change_detection/pipe_transform.js +1 -2
- package/esm5/src/change_detection.js +1 -2
- package/esm5/src/codegen_private_exports.js +1 -2
- package/esm5/src/console.js +1 -2
- package/esm5/src/core.js +1 -2
- package/esm5/src/core_private_export.js +1 -2
- package/esm5/src/core_render3_private_export.js +7 -5
- package/esm5/src/debug/debug_node.js +79 -58
- package/esm5/src/di/defs.js +3 -4
- package/esm5/src/di/forward_ref.js +1 -2
- package/esm5/src/di/injectable.js +1 -2
- package/esm5/src/di/injection_token.js +1 -2
- package/esm5/src/di/injector.js +1 -2
- package/esm5/src/di/injector_compatibility.js +1 -2
- package/esm5/src/di/metadata.js +1 -2
- package/esm5/src/di/provider.js +1 -2
- package/esm5/src/di/r3_injector.js +48 -28
- package/esm5/src/di/reflective_errors.js +1 -2
- package/esm5/src/di/reflective_injector.js +1 -2
- package/esm5/src/di/reflective_key.js +1 -2
- package/esm5/src/di/reflective_provider.js +1 -2
- package/esm5/src/di/scope.js +1 -2
- package/esm5/src/di/util.js +1 -2
- package/esm5/src/di.js +1 -2
- package/esm5/src/error_handler.js +1 -2
- package/esm5/src/errors.js +1 -2
- package/esm5/src/event_emitter.js +1 -2
- package/esm5/src/i18n/tokens.js +1 -2
- package/esm5/src/is_dev_mode.js +1 -2
- package/esm5/src/ivy_switch.js +1 -2
- package/esm5/src/linker/compiler.js +1 -2
- package/esm5/src/linker/component_factory.js +1 -2
- package/esm5/src/linker/component_factory_resolver.js +1 -2
- package/esm5/src/linker/element_ref.js +1 -2
- package/esm5/src/linker/ng_module_factory.js +1 -2
- package/esm5/src/linker/ng_module_factory_loader.js +37 -13
- package/esm5/src/linker/query_list.js +1 -2
- package/esm5/src/linker/system_js_ng_module_factory_loader.js +1 -2
- package/esm5/src/linker/template_ref.js +1 -2
- package/esm5/src/linker/view_container_ref.js +1 -2
- package/esm5/src/linker/view_ref.js +1 -2
- package/esm5/src/linker.js +1 -2
- package/esm5/src/metadata/di.js +1 -2
- package/esm5/src/metadata/directives.js +1 -2
- package/esm5/src/metadata/lifecycle_hooks.js +1 -2
- package/esm5/src/metadata/ng_module.js +1 -2
- package/esm5/src/metadata/resource_loading.js +1 -2
- package/esm5/src/metadata/view.js +1 -2
- package/esm5/src/metadata.js +1 -2
- package/esm5/src/platform_core_providers.js +1 -2
- package/esm5/src/profile/profile.js +1 -2
- package/esm5/src/profile/wtf_impl.js +1 -2
- package/esm5/src/r3_symbols.js +1 -2
- package/esm5/src/reflection/platform_reflection_capabilities.js +1 -2
- package/esm5/src/reflection/reflection.js +1 -2
- package/esm5/src/reflection/reflection_capabilities.js +1 -2
- package/esm5/src/reflection/reflector.js +1 -2
- package/esm5/src/reflection/types.js +1 -2
- package/esm5/src/render/api.js +1 -2
- package/esm5/src/render.js +1 -2
- package/esm5/src/render3/assert.js +15 -2
- package/esm5/src/render3/bindings.js +63 -0
- package/esm5/src/render3/component.js +23 -16
- package/esm5/src/render3/component_ref.js +43 -36
- package/esm5/src/render3/context_discovery.js +68 -77
- package/esm5/src/render3/definition.js +30 -24
- package/esm5/src/render3/di.js +142 -135
- package/esm5/src/render3/di_setup.js +20 -21
- package/esm5/src/render3/discovery_utils.js +167 -36
- package/esm5/src/render3/empty.js +22 -0
- package/esm5/src/render3/errors.js +9 -12
- package/esm5/src/render3/features/inherit_definition_feature.js +3 -5
- package/esm5/src/render3/features/ng_onchanges_feature.js +11 -10
- package/esm5/src/render3/features/providers_feature.js +1 -2
- package/esm5/src/render3/fields.js +1 -2
- package/esm5/src/render3/global_utils.js +4 -3
- package/esm5/src/render3/global_utils_api.js +2 -3
- package/esm5/src/render3/hooks.js +14 -16
- package/esm5/src/render3/i18n.js +22 -27
- package/esm5/src/render3/index.js +5 -6
- package/esm5/src/render3/instructions.js +698 -593
- package/esm5/src/render3/interfaces/container.js +10 -3
- package/esm5/src/render3/interfaces/context.js +1 -2
- package/esm5/src/render3/interfaces/definition.js +1 -2
- package/esm5/src/render3/interfaces/i18n.js +1 -2
- package/esm5/src/render3/interfaces/injector.js +5 -6
- package/esm5/src/render3/interfaces/node.js +1 -2
- package/esm5/src/render3/interfaces/player.js +1 -2
- package/esm5/src/render3/interfaces/projection.js +1 -2
- package/esm5/src/render3/interfaces/query.js +1 -2
- package/esm5/src/render3/interfaces/renderer.js +1 -2
- package/esm5/src/render3/interfaces/sanitization.js +1 -2
- package/esm5/src/render3/interfaces/styling.js +1 -2
- package/esm5/src/render3/interfaces/view.js +3 -4
- package/esm5/src/render3/jit/compiler_facade.js +1 -2
- package/esm5/src/render3/jit/compiler_facade_interface.js +1 -2
- package/esm5/src/render3/jit/directive.js +19 -10
- package/esm5/src/render3/jit/environment.js +4 -2
- package/esm5/src/render3/jit/injectable.js +17 -18
- package/esm5/src/render3/jit/module.js +207 -13
- package/esm5/src/render3/jit/pipe.js +1 -2
- package/esm5/src/render3/jit/util.js +1 -2
- package/esm5/src/render3/metadata.js +1 -2
- package/esm5/src/render3/ng_dev_mode.js +1 -2
- package/esm5/src/render3/ng_module_ref.js +29 -11
- package/esm5/src/render3/node_assert.js +1 -2
- package/esm5/src/render3/node_manipulation.js +54 -50
- package/esm5/src/render3/node_selector_matcher.js +28 -9
- package/esm5/src/render3/pipe.js +33 -19
- package/esm5/src/render3/players.js +7 -9
- package/esm5/src/render3/pure_function.js +48 -38
- package/esm5/src/render3/query.js +8 -9
- package/esm5/src/render3/state.js +50 -135
- package/esm5/src/render3/styling/class_and_style_bindings.js +684 -214
- package/esm5/src/render3/styling/core_player_handler.js +1 -2
- package/esm5/src/render3/styling/player_factory.js +1 -2
- package/esm5/src/render3/styling/util.js +39 -22
- package/esm5/src/render3/tokens.js +1 -2
- package/esm5/src/render3/util.js +49 -37
- package/esm5/src/render3/view_engine_compatibility.js +20 -33
- package/esm5/src/render3/view_engine_compatibility_prebound.js +1 -2
- package/esm5/src/render3/view_ref.js +33 -30
- package/esm5/src/sanitization/bypass.js +1 -2
- package/esm5/src/sanitization/html_sanitizer.js +1 -2
- package/esm5/src/sanitization/inert_body.js +4 -5
- package/esm5/src/sanitization/sanitization.js +25 -20
- package/esm5/src/sanitization/security.js +1 -2
- package/esm5/src/sanitization/style_sanitizer.js +1 -2
- package/esm5/src/sanitization/url_sanitizer.js +1 -2
- package/esm5/src/testability/testability.js +1 -2
- package/esm5/src/type.js +1 -2
- package/esm5/src/util/decorators.js +1 -2
- package/esm5/src/util/lang.js +1 -2
- package/esm5/src/util/ng_reflect.js +1 -2
- package/esm5/src/util/noop.js +1 -2
- package/esm5/src/util/property.js +1 -2
- package/esm5/src/util.js +1 -2
- package/esm5/src/version.js +2 -3
- package/esm5/src/view/element.js +1 -2
- package/esm5/src/view/entrypoint.js +1 -2
- package/esm5/src/view/errors.js +1 -2
- package/esm5/src/view/index.js +1 -2
- package/esm5/src/view/ng_content.js +1 -2
- package/esm5/src/view/ng_module.js +1 -2
- package/esm5/src/view/provider.js +1 -2
- package/esm5/src/view/pure_expression.js +1 -2
- package/esm5/src/view/query.js +1 -2
- package/esm5/src/view/refs.js +1 -2
- package/esm5/src/view/services.js +1 -2
- package/esm5/src/view/text.js +1 -2
- package/esm5/src/view/types.js +1 -2
- package/esm5/src/view/util.js +1 -2
- package/esm5/src/view/view.js +1 -2
- package/esm5/src/view/view_attach.js +1 -2
- package/esm5/src/zone/ng_zone.js +1 -2
- package/esm5/src/zone.js +1 -2
- package/esm5/testing/index.js +1 -2
- package/esm5/testing/public_api.js +1 -2
- package/esm5/testing/src/async.js +1 -2
- package/esm5/testing/src/async_fallback.js +1 -2
- package/esm5/testing/src/async_test_completer.js +1 -2
- package/esm5/testing/src/before_each.js +1 -2
- package/esm5/testing/src/component_fixture.js +1 -2
- package/esm5/testing/src/fake_async.js +1 -2
- package/esm5/testing/src/fake_async_fallback.js +1 -2
- package/esm5/testing/src/lang_utils.js +1 -2
- package/esm5/testing/src/logger.js +1 -2
- package/esm5/testing/src/metadata_override.js +1 -2
- package/esm5/testing/src/metadata_overrider.js +1 -2
- package/esm5/testing/src/ng_zone_mock.js +1 -2
- package/esm5/testing/src/private_export_testing.js +1 -2
- package/esm5/testing/src/r3_test_bed.js +182 -121
- package/esm5/testing/src/resolvers.js +11 -7
- package/esm5/testing/src/test_bed.js +1 -2
- package/esm5/testing/src/test_bed_common.js +1 -2
- package/esm5/testing/src/test_compiler.js +1 -2
- package/esm5/testing/src/testing.js +1 -2
- package/esm5/testing/src/testing_internal.js +2 -3
- package/esm5/testing/testing.js +1 -2
- package/fesm2015/core.js +8560 -6153
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +351 -229
- package/fesm2015/testing.js.map +1 -1
- package/fesm5/core.js +5541 -4482
- package/fesm5/core.js.map +1 -1
- package/fesm5/testing.js +185 -130
- package/fesm5/testing.js.map +1 -1
- package/package.json +1 -1
- package/src/change_detection/constants.d.ts +2 -2
- package/src/core_render3_private_export.d.ts +6 -3
- package/src/di/injectable.d.ts +3 -2
- package/src/di/r3_injector.d.ts +1 -1
- package/src/linker/ng_module_factory_loader.d.ts +5 -1
- package/src/render3/assert.d.ts +6 -0
- package/src/render3/bindings.d.ts +20 -0
- package/src/render3/component.d.ts +3 -3
- package/src/render3/component_ref.d.ts +14 -4
- package/src/render3/context_discovery.d.ts +9 -9
- package/src/render3/definition.d.ts +8 -23
- package/src/render3/di.d.ts +19 -17
- package/src/render3/discovery_utils.d.ts +66 -8
- package/src/render3/empty.d.ts +16 -0
- package/src/render3/errors.d.ts +1 -1
- package/src/render3/global_utils_api.d.ts +1 -1
- package/src/render3/hooks.d.ts +7 -6
- package/src/render3/index.d.ts +4 -4
- package/src/render3/instructions.d.ts +163 -118
- package/src/render3/interfaces/container.d.ts +9 -8
- package/src/render3/interfaces/context.d.ts +3 -3
- package/src/render3/interfaces/definition.d.ts +2 -12
- package/src/render3/interfaces/i18n.d.ts +25 -25
- package/src/render3/interfaces/injector.d.ts +8 -9
- package/src/render3/interfaces/node.d.ts +56 -23
- package/src/render3/interfaces/renderer.d.ts +2 -1
- package/src/render3/interfaces/styling.d.ts +392 -117
- package/src/render3/interfaces/view.d.ts +49 -35
- package/src/render3/jit/compiler_facade_interface.d.ts +10 -3
- package/src/render3/jit/module.d.ts +9 -1
- package/src/render3/metadata.d.ts +1 -1
- package/src/render3/ng_module_ref.d.ts +8 -6
- package/src/render3/node_manipulation.d.ts +21 -27
- package/src/render3/node_selector_matcher.d.ts +2 -2
- package/src/render3/state.d.ts +11 -38
- package/src/render3/styling/class_and_style_bindings.d.ts +130 -43
- package/src/render3/styling/util.d.ts +9 -4
- package/src/render3/util.d.ts +31 -25
- package/src/render3/view_engine_compatibility.d.ts +5 -12
- package/src/render3/view_engine_compatibility_prebound.d.ts +2 -2
- package/src/render3/view_ref.d.ts +2 -2
- package/src/sanitization/sanitization.d.ts +3 -2
- package/testing/src/r3_test_bed.d.ts +15 -0
- package/testing/src/resolvers.d.ts +2 -2
- package/testing/testing.metadata.json +1 -1
- package/testing.d.ts +5 -0
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ export declare enum ChangeDetectionStrategy {
|
|
|
15
15
|
/**
|
|
16
16
|
* Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated
|
|
17
17
|
* until reactivated by setting the strategy to `Default` (`CheckAlways`).
|
|
18
|
-
* Change detection can still be
|
|
18
|
+
* Change detection can still be explicitly invoked.
|
|
19
19
|
*/
|
|
20
20
|
OnPush = 0,
|
|
21
21
|
/**
|
|
@@ -40,7 +40,7 @@ export declare enum ChangeDetectorStatus {
|
|
|
40
40
|
*/
|
|
41
41
|
Checked = 1,
|
|
42
42
|
/**
|
|
43
|
-
* A state in which change detection continues automatically until
|
|
43
|
+
* A state in which change detection continues automatically until explicitly
|
|
44
44
|
* deactivated.
|
|
45
45
|
*/
|
|
46
46
|
CheckAlways = 2,
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
export { defineBase as ɵdefineBase, defineComponent as ɵdefineComponent, defineDirective as ɵdefineDirective, definePipe as ɵdefinePipe, defineNgModule as ɵdefineNgModule, detectChanges as ɵdetectChanges, renderComponent as ɵrenderComponent, ComponentType as ɵComponentType, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, DirectiveType as ɵDirectiveType, RenderFlags as ɵRenderFlags, directiveInject as ɵdirectiveInject, injectAttribute as ɵinjectAttribute, getFactoryOf as ɵgetFactoryOf, getInheritedFactory as ɵgetInheritedFactory, templateRefExtractor as ɵtemplateRefExtractor, ProvidersFeature as ɵProvidersFeature, InheritDefinitionFeature as ɵInheritDefinitionFeature, NgOnChangesFeature as ɵNgOnChangesFeature, LifecycleHooksFeature as ɵLifecycleHooksFeature, NgModuleType as ɵNgModuleType, NgModuleRef as ɵRender3NgModuleRef, CssSelectorList as ɵCssSelectorList, markDirty as ɵmarkDirty, NgModuleFactory as ɵNgModuleFactory, NO_CHANGE as ɵNO_CHANGE, container as ɵcontainer, nextContext as ɵnextContext, elementStart as ɵelementStart, namespaceHTML as ɵnamespaceHTML, namespaceMathML as ɵnamespaceMathML, namespaceSVG as ɵnamespaceSVG, element as ɵelement, listener as ɵlistener, text as ɵtext, embeddedViewStart as ɵembeddedViewStart, query as ɵquery, registerContentQuery as ɵregisterContentQuery, projection as ɵprojection, bind as ɵbind, interpolation1 as ɵinterpolation1, interpolation2 as ɵinterpolation2, interpolation3 as ɵinterpolation3, interpolation4 as ɵinterpolation4, interpolation5 as ɵinterpolation5, interpolation6 as ɵinterpolation6, interpolation7 as ɵinterpolation7, interpolation8 as ɵinterpolation8, interpolationV as ɵinterpolationV, pipeBind1 as ɵpipeBind1, pipeBind2 as ɵpipeBind2, pipeBind3 as ɵpipeBind3, pipeBind4 as ɵpipeBind4, pipeBindV as ɵpipeBindV, pureFunction0 as ɵpureFunction0, pureFunction1 as ɵpureFunction1, pureFunction2 as ɵpureFunction2, pureFunction3 as ɵpureFunction3, pureFunction4 as ɵpureFunction4, pureFunction5 as ɵpureFunction5, pureFunction6 as ɵpureFunction6, pureFunction7 as ɵpureFunction7, pureFunction8 as ɵpureFunction8, pureFunctionV as ɵpureFunctionV, getCurrentView as ɵgetCurrentView, restoreView as ɵrestoreView, containerRefreshStart as ɵcontainerRefreshStart, containerRefreshEnd as ɵcontainerRefreshEnd, queryRefresh as ɵqueryRefresh, loadQueryList as ɵloadQueryList, elementEnd as ɵelementEnd, elementProperty as ɵelementProperty, projectionDef as ɵprojectionDef, reference as ɵreference, enableBindings as ɵenableBindings, disableBindings as ɵdisableBindings, elementAttribute as ɵelementAttribute, elementContainerStart as ɵelementContainerStart, elementContainerEnd as ɵelementContainerEnd, elementStyling as ɵelementStyling, elementStylingMap as ɵelementStylingMap, elementStyleProp as ɵelementStyleProp, elementStylingApply as ɵelementStylingApply, elementClassProp as ɵelementClassProp, textBinding as ɵtextBinding, template as ɵtemplate, embeddedViewEnd as ɵembeddedViewEnd, store as ɵstore, load as ɵload, pipe as ɵpipe, BaseDef as ɵBaseDef, ComponentDef as ɵComponentDef, ComponentDefWithMeta as ɵComponentDefWithMeta, DirectiveDef as ɵDirectiveDef, DirectiveDefWithMeta as ɵDirectiveDefWithMeta, PipeDef as ɵPipeDef, PipeDefWithMeta as ɵPipeDefWithMeta, whenRendered as ɵwhenRendered, i18n as ɵi18n, i18nAttributes as ɵi18nAttributes, i18nExp as ɵi18nExp, i18nStart as ɵi18nStart, i18nEnd as ɵi18nEnd, i18nApply as ɵi18nApply, i18nPostprocess as ɵi18nPostprocess, setClassMetadata as ɵsetClassMetadata, } from './render3/index';
|
|
8
|
+
export { defineBase as ɵdefineBase, defineComponent as ɵdefineComponent, defineDirective as ɵdefineDirective, definePipe as ɵdefinePipe, defineNgModule as ɵdefineNgModule, detectChanges as ɵdetectChanges, renderComponent as ɵrenderComponent, AttributeMarker as ɵAttributeMarker, ComponentType as ɵComponentType, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, DirectiveType as ɵDirectiveType, RenderFlags as ɵRenderFlags, directiveInject as ɵdirectiveInject, injectAttribute as ɵinjectAttribute, getFactoryOf as ɵgetFactoryOf, getInheritedFactory as ɵgetInheritedFactory, templateRefExtractor as ɵtemplateRefExtractor, ProvidersFeature as ɵProvidersFeature, InheritDefinitionFeature as ɵInheritDefinitionFeature, NgOnChangesFeature as ɵNgOnChangesFeature, LifecycleHooksFeature as ɵLifecycleHooksFeature, NgModuleType as ɵNgModuleType, NgModuleRef as ɵRender3NgModuleRef, CssSelectorList as ɵCssSelectorList, markDirty as ɵmarkDirty, NgModuleFactory as ɵNgModuleFactory, NO_CHANGE as ɵNO_CHANGE, container as ɵcontainer, nextContext as ɵnextContext, elementStart as ɵelementStart, namespaceHTML as ɵnamespaceHTML, namespaceMathML as ɵnamespaceMathML, namespaceSVG as ɵnamespaceSVG, element as ɵelement, listener as ɵlistener, text as ɵtext, embeddedViewStart as ɵembeddedViewStart, query as ɵquery, registerContentQuery as ɵregisterContentQuery, projection as ɵprojection, bind as ɵbind, interpolation1 as ɵinterpolation1, interpolation2 as ɵinterpolation2, interpolation3 as ɵinterpolation3, interpolation4 as ɵinterpolation4, interpolation5 as ɵinterpolation5, interpolation6 as ɵinterpolation6, interpolation7 as ɵinterpolation7, interpolation8 as ɵinterpolation8, interpolationV as ɵinterpolationV, pipeBind1 as ɵpipeBind1, pipeBind2 as ɵpipeBind2, pipeBind3 as ɵpipeBind3, pipeBind4 as ɵpipeBind4, pipeBindV as ɵpipeBindV, pureFunction0 as ɵpureFunction0, pureFunction1 as ɵpureFunction1, pureFunction2 as ɵpureFunction2, pureFunction3 as ɵpureFunction3, pureFunction4 as ɵpureFunction4, pureFunction5 as ɵpureFunction5, pureFunction6 as ɵpureFunction6, pureFunction7 as ɵpureFunction7, pureFunction8 as ɵpureFunction8, pureFunctionV as ɵpureFunctionV, getCurrentView as ɵgetCurrentView, getHostElement as ɵgetHostElement, restoreView as ɵrestoreView, containerRefreshStart as ɵcontainerRefreshStart, containerRefreshEnd as ɵcontainerRefreshEnd, queryRefresh as ɵqueryRefresh, loadQueryList as ɵloadQueryList, elementEnd as ɵelementEnd, elementProperty as ɵelementProperty, componentHostSyntheticProperty as ɵcomponentHostSyntheticProperty, projectionDef as ɵprojectionDef, reference as ɵreference, enableBindings as ɵenableBindings, disableBindings as ɵdisableBindings, allocHostVars as ɵallocHostVars, elementAttribute as ɵelementAttribute, elementContainerStart as ɵelementContainerStart, elementContainerEnd as ɵelementContainerEnd, elementStyling as ɵelementStyling, elementHostAttrs as ɵelementHostAttrs, elementStylingMap as ɵelementStylingMap, elementStyleProp as ɵelementStyleProp, elementStylingApply as ɵelementStylingApply, elementClassProp as ɵelementClassProp, textBinding as ɵtextBinding, template as ɵtemplate, embeddedViewEnd as ɵembeddedViewEnd, store as ɵstore, load as ɵload, pipe as ɵpipe, BaseDef as ɵBaseDef, ComponentDef as ɵComponentDef, ComponentDefWithMeta as ɵComponentDefWithMeta, DirectiveDef as ɵDirectiveDef, DirectiveDefWithMeta as ɵDirectiveDefWithMeta, PipeDef as ɵPipeDef, PipeDefWithMeta as ɵPipeDefWithMeta, whenRendered as ɵwhenRendered, i18n as ɵi18n, i18nAttributes as ɵi18nAttributes, i18nExp as ɵi18nExp, i18nStart as ɵi18nStart, i18nEnd as ɵi18nEnd, i18nApply as ɵi18nApply, i18nPostprocess as ɵi18nPostprocess, setClassMetadata as ɵsetClassMetadata, } from './render3/index';
|
|
9
9
|
export { compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, } from './render3/jit/directive';
|
|
10
|
-
export { compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, patchComponentDefWithScope as ɵpatchComponentDefWithScope, } from './render3/jit/module';
|
|
10
|
+
export { compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, patchComponentDefWithScope as ɵpatchComponentDefWithScope, resetCompiledComponents as ɵresetCompiledComponents, } from './render3/jit/module';
|
|
11
11
|
export { compilePipe as ɵcompilePipe, } from './render3/jit/pipe';
|
|
12
12
|
export { NgModuleDef as ɵNgModuleDef, NgModuleDefWithMeta as ɵNgModuleDefWithMeta, NgModuleTransitiveScopes as ɵNgModuleTransitiveScopes, } from './metadata/ng_module';
|
|
13
13
|
export { sanitizeHtml as ɵsanitizeHtml, sanitizeStyle as ɵsanitizeStyle, sanitizeUrl as ɵsanitizeUrl, sanitizeResourceUrl as ɵsanitizeResourceUrl, } from './sanitization/sanitization';
|
|
14
14
|
export { bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, } from './sanitization/bypass';
|
|
15
|
-
export {
|
|
15
|
+
export { getLContext as ɵgetLContext } from './render3/context_discovery';
|
|
16
16
|
export { Player as ɵPlayer, PlayerFactory as ɵPlayerFactory, PlayState as ɵPlayState, PlayerHandler as ɵPlayerHandler, } from './render3/interfaces/player';
|
|
17
17
|
export { LContext as ɵLContext, } from './render3/interfaces/context';
|
|
18
18
|
export { bindPlayerFactory as ɵbindPlayerFactory, } from './render3/styling/player_factory';
|
|
@@ -20,12 +20,15 @@ export { addPlayer as ɵaddPlayer, getPlayers as ɵgetPlayers, } from './render3
|
|
|
20
20
|
export { compileNgModuleFactory__POST_R3__ as ɵcompileNgModuleFactory__POST_R3__ } from './application_ref';
|
|
21
21
|
export { SWITCH_COMPILE_COMPONENT__POST_R3__ as ɵSWITCH_COMPILE_COMPONENT__POST_R3__, SWITCH_COMPILE_DIRECTIVE__POST_R3__ as ɵSWITCH_COMPILE_DIRECTIVE__POST_R3__, SWITCH_COMPILE_PIPE__POST_R3__ as ɵSWITCH_COMPILE_PIPE__POST_R3__, } from './metadata/directives';
|
|
22
22
|
export { SWITCH_COMPILE_NGMODULE__POST_R3__ as ɵSWITCH_COMPILE_NGMODULE__POST_R3__, } from './metadata/ng_module';
|
|
23
|
+
export { getDebugNode__POST_R3__ as ɵgetDebugNode__POST_R3__, } from './debug/debug_node';
|
|
23
24
|
export { SWITCH_COMPILE_INJECTABLE__POST_R3__ as ɵSWITCH_COMPILE_INJECTABLE__POST_R3__, } from './di/injectable';
|
|
24
25
|
export { SWITCH_IVY_ENABLED__POST_R3__ as ɵSWITCH_IVY_ENABLED__POST_R3__, } from './ivy_switch';
|
|
25
26
|
export { SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ as ɵSWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__, } from './change_detection/change_detector_ref';
|
|
27
|
+
export { Compiler_compileModuleSync__POST_R3__ as ɵCompiler_compileModuleSync__POST_R3__, Compiler_compileModuleAsync__POST_R3__ as ɵCompiler_compileModuleAsync__POST_R3__, Compiler_compileModuleAndAllComponentsSync__POST_R3__ as ɵCompiler_compileModuleAndAllComponentsSync__POST_R3__, Compiler_compileModuleAndAllComponentsAsync__POST_R3__ as ɵCompiler_compileModuleAndAllComponentsAsync__POST_R3__, } from './linker/compiler';
|
|
26
28
|
export { SWITCH_ELEMENT_REF_FACTORY__POST_R3__ as ɵSWITCH_ELEMENT_REF_FACTORY__POST_R3__, } from './linker/element_ref';
|
|
27
29
|
export { SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ as ɵSWITCH_TEMPLATE_REF_FACTORY__POST_R3__, } from './linker/template_ref';
|
|
28
30
|
export { SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ as ɵSWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__, } from './linker/view_container_ref';
|
|
29
31
|
export { SWITCH_RENDERER2_FACTORY__POST_R3__ as ɵSWITCH_RENDERER2_FACTORY__POST_R3__, } from './render/api';
|
|
32
|
+
export { getModuleFactory__POST_R3__ as ɵgetModuleFactory__POST_R3__ } from './linker/ng_module_factory_loader';
|
|
30
33
|
export { publishGlobalUtil as ɵpublishGlobalUtil, publishDefaultGlobalUtils as ɵpublishDefaultGlobalUtils } from './render3/global_utils';
|
|
31
34
|
export { SWITCH_INJECTOR_FACTORY__POST_R3__ as ɵSWITCH_INJECTOR_FACTORY__POST_R3__, } from './di/injector';
|
package/src/di/injectable.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { compileInjectable as render3CompileInjectable } from '../render3/jit/injectable';
|
|
9
9
|
import { Type } from '../type';
|
|
10
|
+
import { TypeDecorator } from '../util/decorators';
|
|
10
11
|
import { InjectableDef } from './defs';
|
|
11
12
|
import { ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueSansProvider } from './provider';
|
|
12
13
|
/**
|
|
@@ -37,10 +38,10 @@ export interface InjectableDecorator {
|
|
|
37
38
|
* {@example core/di/ts/metadata_spec.ts region='InjectableThrows'}
|
|
38
39
|
*
|
|
39
40
|
*/
|
|
40
|
-
():
|
|
41
|
+
(): TypeDecorator;
|
|
41
42
|
(options?: {
|
|
42
43
|
providedIn: Type<any> | 'root' | null;
|
|
43
|
-
} & InjectableProvider):
|
|
44
|
+
} & InjectableProvider): TypeDecorator;
|
|
44
45
|
new (): Injectable;
|
|
45
46
|
new (options?: {
|
|
46
47
|
providedIn: Type<any> | 'root' | null;
|
package/src/di/r3_injector.d.ts
CHANGED
|
@@ -71,6 +71,6 @@ export declare class R3Injector {
|
|
|
71
71
|
*
|
|
72
72
|
* @param provider provider to convert to factory
|
|
73
73
|
*/
|
|
74
|
-
export declare function providerToFactory(provider: SingleProvider): () => any;
|
|
74
|
+
export declare function providerToFactory(provider: SingleProvider, ngModuleType?: InjectorType<any>, providers?: any[]): () => any;
|
|
75
75
|
export declare function isTypeProvider(value: SingleProvider): value is TypeProvider;
|
|
76
76
|
export {};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
+
import { NgModuleType } from '../render3/ng_module_ref';
|
|
8
9
|
import { NgModuleFactory } from './ng_module_factory';
|
|
9
10
|
/**
|
|
10
11
|
* Used to load ng module factories.
|
|
@@ -19,11 +20,14 @@ export declare abstract class NgModuleFactoryLoader {
|
|
|
19
20
|
* @publicApi
|
|
20
21
|
*/
|
|
21
22
|
export declare function registerModuleFactory(id: string, factory: NgModuleFactory<any>): void;
|
|
23
|
+
export declare function registerNgModuleType(id: string, ngModuleType: NgModuleType): void;
|
|
22
24
|
export declare function clearModulesForTest(): void;
|
|
25
|
+
export declare function getModuleFactory__PRE_R3__(id: string): NgModuleFactory<any>;
|
|
26
|
+
export declare function getModuleFactory__POST_R3__(id: string): NgModuleFactory<any>;
|
|
23
27
|
/**
|
|
24
28
|
* Returns the NgModuleFactory with the given id, if it exists and has been loaded.
|
|
25
29
|
* Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module
|
|
26
30
|
* cannot be found.
|
|
27
31
|
* @publicApi
|
|
28
32
|
*/
|
|
29
|
-
export declare
|
|
33
|
+
export declare const getModuleFactory: (id: string) => NgModuleFactory<any>;
|
package/src/render3/assert.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
+
import { TNode } from './interfaces/node';
|
|
9
|
+
import { LView } from './interfaces/view';
|
|
8
10
|
export declare function assertNumber(actual: any, msg: string): void;
|
|
9
11
|
export declare function assertEqual<T>(actual: T, expected: T, msg: string): void;
|
|
10
12
|
export declare function assertNotEqual<T>(actual: T, expected: T, msg: string): void;
|
|
@@ -16,3 +18,7 @@ export declare function assertDefined<T>(actual: T, msg: string): void;
|
|
|
16
18
|
export declare function assertComponentType(actual: any, msg?: string): void;
|
|
17
19
|
export declare function assertNgModuleType(actual: any, msg?: string): void;
|
|
18
20
|
export declare function assertDomNode(node: any): void;
|
|
21
|
+
export declare function assertPreviousIsParent(isParent: boolean): void;
|
|
22
|
+
export declare function assertHasParent(tNode: TNode): void;
|
|
23
|
+
export declare function assertDataNext(lView: LView, index: number, arr?: any[]): void;
|
|
24
|
+
export declare function assertDataInRange(arr: any[], index: number): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { LView } from './interfaces/view';
|
|
9
|
+
/** Updates binding and returns the value. */
|
|
10
|
+
export declare function updateBinding(lView: LView, bindingIndex: number, value: any): any;
|
|
11
|
+
/** Gets the current binding value. */
|
|
12
|
+
export declare function getBinding(lView: LView, bindingIndex: number): any;
|
|
13
|
+
/** Updates binding if changed, then returns whether it was updated. */
|
|
14
|
+
export declare function bindingUpdated(lView: LView, bindingIndex: number, value: any): boolean;
|
|
15
|
+
/** Updates 2 bindings if changed, then returns whether either was updated. */
|
|
16
|
+
export declare function bindingUpdated2(lView: LView, bindingIndex: number, exp1: any, exp2: any): boolean;
|
|
17
|
+
/** Updates 3 bindings if changed, then returns whether any was updated. */
|
|
18
|
+
export declare function bindingUpdated3(lView: LView, bindingIndex: number, exp1: any, exp2: any, exp3: any): boolean;
|
|
19
|
+
/** Updates 4 bindings if changed, then returns whether any was updated. */
|
|
20
|
+
export declare function bindingUpdated4(lView: LView, bindingIndex: number, exp1: any, exp2: any, exp3: any, exp4: any): boolean;
|
|
@@ -11,7 +11,7 @@ import { Sanitizer } from '../sanitization/security';
|
|
|
11
11
|
import { ComponentDef, ComponentType } from './interfaces/definition';
|
|
12
12
|
import { PlayerHandler } from './interfaces/player';
|
|
13
13
|
import { RElement, Renderer3, RendererFactory3 } from './interfaces/renderer';
|
|
14
|
-
import {
|
|
14
|
+
import { LView, RootContext } from './interfaces/view';
|
|
15
15
|
/** Options that control how the component should be bootstrapped. */
|
|
16
16
|
export interface CreateComponentOptions {
|
|
17
17
|
/** Which renderer factory to use. */
|
|
@@ -82,12 +82,12 @@ export declare function renderComponent<T>(componentType: ComponentType<T> | Typ
|
|
|
82
82
|
*
|
|
83
83
|
* @returns Component view created
|
|
84
84
|
*/
|
|
85
|
-
export declare function createRootComponentView(rNode: RElement | null, def: ComponentDef<any>, rootView:
|
|
85
|
+
export declare function createRootComponentView(rNode: RElement | null, def: ComponentDef<any>, rootView: LView, rendererFactory: RendererFactory3, renderer: Renderer3, sanitizer?: Sanitizer | null): LView;
|
|
86
86
|
/**
|
|
87
87
|
* Creates a root component and sets it up with features and host bindings. Shared by
|
|
88
88
|
* renderComponent() and ViewContainerRef.createComponent().
|
|
89
89
|
*/
|
|
90
|
-
export declare function createRootComponent<T>(componentView:
|
|
90
|
+
export declare function createRootComponent<T>(componentView: LView, componentDef: ComponentDef<T>, rootView: LView, rootContext: RootContext, hostFeatures: HostFeature[] | null): any;
|
|
91
91
|
export declare function createRootContext(scheduler?: (workFn: () => void) => void, playerHandler?: PlayerHandler | null): RootContext;
|
|
92
92
|
/**
|
|
93
93
|
* Used to enable lifecycle hooks on the root component.
|
|
@@ -15,9 +15,14 @@ import { NgModuleRef as viewEngine_NgModuleRef } from '../linker/ng_module_facto
|
|
|
15
15
|
import { Type } from '../type';
|
|
16
16
|
import { ComponentDef } from './interfaces/definition';
|
|
17
17
|
import { TContainerNode, TElementContainerNode, TElementNode } from './interfaces/node';
|
|
18
|
-
import {
|
|
18
|
+
import { LView, RootContext } from './interfaces/view';
|
|
19
19
|
import { ViewRef } from './view_ref';
|
|
20
20
|
export declare class ComponentFactoryResolver extends viewEngine_ComponentFactoryResolver {
|
|
21
|
+
private ngModule?;
|
|
22
|
+
/**
|
|
23
|
+
* @param ngModule The NgModuleRef to which all resolved factories are bound.
|
|
24
|
+
*/
|
|
25
|
+
constructor(ngModule?: viewEngine_NgModuleRef<any> | undefined);
|
|
21
26
|
resolveComponentFactory<T>(component: Type<T>): viewEngine_ComponentFactory<T>;
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
@@ -34,6 +39,7 @@ export declare const SCHEDULER: InjectionToken<(fn: () => void) => void>;
|
|
|
34
39
|
*/
|
|
35
40
|
export declare class ComponentFactory<T> extends viewEngine_ComponentFactory<T> {
|
|
36
41
|
private componentDef;
|
|
42
|
+
private ngModule?;
|
|
37
43
|
selector: string;
|
|
38
44
|
componentType: Type<any>;
|
|
39
45
|
ngContentSelectors: string[];
|
|
@@ -45,7 +51,11 @@ export declare class ComponentFactory<T> extends viewEngine_ComponentFactory<T>
|
|
|
45
51
|
propName: string;
|
|
46
52
|
templateName: string;
|
|
47
53
|
}[];
|
|
48
|
-
|
|
54
|
+
/**
|
|
55
|
+
* @param componentDef The component definition.
|
|
56
|
+
* @param ngModule The NgModuleRef to which the factory is bound.
|
|
57
|
+
*/
|
|
58
|
+
constructor(componentDef: ComponentDef<any>, ngModule?: viewEngine_NgModuleRef<any> | undefined);
|
|
49
59
|
create(injector: Injector, projectableNodes?: any[][] | undefined, rootSelectorOrNode?: any, ngModule?: viewEngine_NgModuleRef<any> | undefined): viewEngine_ComponentRef<T>;
|
|
50
60
|
}
|
|
51
61
|
/**
|
|
@@ -66,14 +76,14 @@ export declare function injectComponentFactoryResolver(): viewEngine_ComponentFa
|
|
|
66
76
|
*/
|
|
67
77
|
export declare class ComponentRef<T> extends viewEngine_ComponentRef<T> {
|
|
68
78
|
location: viewEngine_ElementRef;
|
|
69
|
-
private
|
|
79
|
+
private _rootLView;
|
|
70
80
|
private _tNode;
|
|
71
81
|
destroyCbs: (() => void)[] | null;
|
|
72
82
|
instance: T;
|
|
73
83
|
hostView: ViewRef<T>;
|
|
74
84
|
changeDetectorRef: ViewEngine_ChangeDetectorRef;
|
|
75
85
|
componentType: Type<T>;
|
|
76
|
-
constructor(componentType: Type<T>, instance: T, location: viewEngine_ElementRef,
|
|
86
|
+
constructor(componentType: Type<T>, instance: T, location: viewEngine_ElementRef, _rootLView: LView, _tNode: TElementNode | TContainerNode | TElementContainerNode);
|
|
77
87
|
readonly injector: Injector;
|
|
78
88
|
destroy(): void;
|
|
79
89
|
onDestroy(callback: () => void): void;
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import './ng_dev_mode';
|
|
9
9
|
import { LContext } from './interfaces/context';
|
|
10
|
-
import {
|
|
10
|
+
import { LView } from './interfaces/view';
|
|
11
11
|
/** Returns the matching `LContext` data for a given DOM node, directive or component instance.
|
|
12
12
|
*
|
|
13
13
|
* This function will examine the provided DOM element, component, or directive instance\'s
|
|
14
14
|
* monkey-patched property to derive the `LContext` data. Once called then the monkey-patched
|
|
15
15
|
* value will be that of the newly created `LContext`.
|
|
16
16
|
*
|
|
17
|
-
* If the monkey-patched value is the `
|
|
17
|
+
* If the monkey-patched value is the `LView` instance then the context value for that
|
|
18
18
|
* target will be created and the monkey-patch reference will be updated. Therefore when this
|
|
19
19
|
* function is called it may mutate the provided element\'s, component\'s or any of the associated
|
|
20
20
|
* directive\'s monkey-patch values.
|
|
@@ -27,19 +27,19 @@ import { LViewData } from './interfaces/view';
|
|
|
27
27
|
*
|
|
28
28
|
* @param target Component, Directive or DOM Node.
|
|
29
29
|
*/
|
|
30
|
-
export declare function
|
|
30
|
+
export declare function getLContext(target: any): LContext | null;
|
|
31
31
|
/**
|
|
32
32
|
* Takes a component instance and returns the view for that component.
|
|
33
33
|
*
|
|
34
34
|
* @param componentInstance
|
|
35
35
|
* @returns The component's view
|
|
36
36
|
*/
|
|
37
|
-
export declare function getComponentViewByInstance(componentInstance: {}):
|
|
37
|
+
export declare function getComponentViewByInstance(componentInstance: {}): LView;
|
|
38
38
|
/**
|
|
39
39
|
* Assigns the given data to the given target (which could be a component,
|
|
40
40
|
* directive or DOM node instance) using monkey-patching.
|
|
41
41
|
*/
|
|
42
|
-
export declare function attachPatchData(target: any, data:
|
|
42
|
+
export declare function attachPatchData(target: any, data: LView | LContext): void;
|
|
43
43
|
export declare function isComponentInstance(instance: any): boolean;
|
|
44
44
|
export declare function isDirectiveInstance(instance: any): boolean;
|
|
45
45
|
/**
|
|
@@ -47,15 +47,15 @@ export declare function isDirectiveInstance(instance: any): boolean;
|
|
|
47
47
|
* provided list of directive index values.
|
|
48
48
|
*
|
|
49
49
|
* @param nodeIndex The node index
|
|
50
|
-
* @param
|
|
50
|
+
* @param lView The target view data
|
|
51
51
|
* @param includeComponents Whether or not to include components in returned directives
|
|
52
52
|
*/
|
|
53
|
-
export declare function getDirectivesAtNodeIndex(nodeIndex: number,
|
|
54
|
-
export declare function getComponentAtNodeIndex(nodeIndex: number,
|
|
53
|
+
export declare function getDirectivesAtNodeIndex(nodeIndex: number, lView: LView, includeComponents: boolean): any[] | null;
|
|
54
|
+
export declare function getComponentAtNodeIndex(nodeIndex: number, lView: LView): {} | null;
|
|
55
55
|
/**
|
|
56
56
|
* Returns a map of local references (local reference name => element or directive instance) that
|
|
57
57
|
* exist on a given element.
|
|
58
58
|
*/
|
|
59
|
-
export declare function discoverLocalRefs(
|
|
59
|
+
export declare function discoverLocalRefs(lView: LView, nodeIndex: number): {
|
|
60
60
|
[key: string]: any;
|
|
61
61
|
} | null;
|
|
@@ -11,9 +11,7 @@ import { NgModuleDef } from '../metadata/ng_module';
|
|
|
11
11
|
import { ViewEncapsulation } from '../metadata/view';
|
|
12
12
|
import { Type } from '../type';
|
|
13
13
|
import { BaseDef, ComponentDef, ComponentDefFeature, ComponentQuery, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFeature, DirectiveType, DirectiveTypesOrFactory, HostBindingsFunction, PipeDef, PipeType, PipeTypesOrFactory } from './interfaces/definition';
|
|
14
|
-
import { CssSelectorList
|
|
15
|
-
export declare const EMPTY: {};
|
|
16
|
-
export declare const EMPTY_ARRAY: any[];
|
|
14
|
+
import { CssSelectorList } from './interfaces/projection';
|
|
17
15
|
/**
|
|
18
16
|
* Create a component definition object.
|
|
19
17
|
*
|
|
@@ -43,24 +41,17 @@ export declare function defineComponent<T>(componentDefinition: {
|
|
|
43
41
|
/**
|
|
44
42
|
* The number of nodes, local refs, and pipes in this component template.
|
|
45
43
|
*
|
|
46
|
-
* Used to calculate the length of this component's
|
|
44
|
+
* Used to calculate the length of this component's LView array, so we
|
|
47
45
|
* can pre-fill the array and set the binding start index.
|
|
48
46
|
*/
|
|
49
47
|
consts: number;
|
|
50
48
|
/**
|
|
51
49
|
* The number of bindings in this component template (including pure fn bindings).
|
|
52
50
|
*
|
|
53
|
-
* Used to calculate the length of this component's
|
|
51
|
+
* Used to calculate the length of this component's LView array, so we
|
|
54
52
|
* can pre-fill the array and set the host binding start index.
|
|
55
53
|
*/
|
|
56
54
|
vars: number;
|
|
57
|
-
/**
|
|
58
|
-
* The number of host bindings (including pure fn bindings) in this component.
|
|
59
|
-
*
|
|
60
|
-
* Used to calculate the length of the LViewData array for the *parent* component
|
|
61
|
-
* of this component.
|
|
62
|
-
*/
|
|
63
|
-
hostVars?: number;
|
|
64
55
|
/**
|
|
65
56
|
* Static attributes to set on host element.
|
|
66
57
|
*
|
|
@@ -88,7 +79,7 @@ export declare function defineComponent<T>(componentDefinition: {
|
|
|
88
79
|
* ```
|
|
89
80
|
* {
|
|
90
81
|
* publicInput1: 'publicInput1',
|
|
91
|
-
* declaredInput2: ['
|
|
82
|
+
* declaredInput2: ['publicInput2', 'declaredInput2'],
|
|
92
83
|
* }
|
|
93
84
|
* ```
|
|
94
85
|
*
|
|
@@ -96,7 +87,7 @@ export declare function defineComponent<T>(componentDefinition: {
|
|
|
96
87
|
* ```
|
|
97
88
|
* {
|
|
98
89
|
* minifiedPublicInput1: 'publicInput1',
|
|
99
|
-
* minifiedDeclaredInput2: [
|
|
90
|
+
* minifiedDeclaredInput2: ['publicInput2', 'declaredInput2'],
|
|
100
91
|
* }
|
|
101
92
|
* ```
|
|
102
93
|
*
|
|
@@ -105,7 +96,7 @@ export declare function defineComponent<T>(componentDefinition: {
|
|
|
105
96
|
*
|
|
106
97
|
* NOTE:
|
|
107
98
|
* - Because declared and public name are usually same we only generate the array
|
|
108
|
-
* `['
|
|
99
|
+
* `['public', 'declared']` format when they differ.
|
|
109
100
|
* - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has
|
|
110
101
|
* inconsistent behavior in that it uses declared names rather than minified or public. For
|
|
111
102
|
* this reason `NgOnChanges` will be deprecated and removed in future version and this
|
|
@@ -323,7 +314,7 @@ export declare const defineDirective: <T>(directiveDefinition: {
|
|
|
323
314
|
*/
|
|
324
315
|
type: Type<T>;
|
|
325
316
|
/** The selectors that will be used to match nodes to this directive. */
|
|
326
|
-
selectors: (string | SelectorFlags)[][];
|
|
317
|
+
selectors: (string | import("@angular/core/src/render3/interfaces/projection").SelectorFlags)[][];
|
|
327
318
|
/**
|
|
328
319
|
* Factory method used to create an instance of directive.
|
|
329
320
|
*/
|
|
@@ -396,13 +387,6 @@ export declare const defineDirective: <T>(directiveDefinition: {
|
|
|
396
387
|
* See: {@link NgOnChangesFeature}, {@link ProvidersFeature}, {@link InheritDefinitionFeature}
|
|
397
388
|
*/
|
|
398
389
|
features?: DirectiveDefFeature[] | undefined;
|
|
399
|
-
/**
|
|
400
|
-
* The number of host bindings (including pure fn bindings) in this directive.
|
|
401
|
-
*
|
|
402
|
-
* Used to calculate the length of the LViewData array for the *parent* component
|
|
403
|
-
* of this directive.
|
|
404
|
-
*/
|
|
405
|
-
hostVars?: number | undefined;
|
|
406
390
|
/**
|
|
407
391
|
* Function executed by the parent template to allow child directive to apply host bindings.
|
|
408
392
|
*/
|
|
@@ -452,4 +436,5 @@ export declare function definePipe<T>(pipeDef: {
|
|
|
452
436
|
export declare function getComponentDef<T>(type: any): ComponentDef<T> | null;
|
|
453
437
|
export declare function getDirectiveDef<T>(type: any): DirectiveDef<T> | null;
|
|
454
438
|
export declare function getPipeDef<T>(type: any): PipeDef<T> | null;
|
|
439
|
+
export declare function getNgModuleDef<T>(type: any, throwNotFound: true): NgModuleDef<T>;
|
|
455
440
|
export declare function getNgModuleDef<T>(type: any): NgModuleDef<T> | null;
|
package/src/render3/di.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { InjectFlags } from '../di/injector_compatibility';
|
|
|
11
11
|
import { Type } from '../type';
|
|
12
12
|
import { RelativeInjectorLocation } from './interfaces/injector';
|
|
13
13
|
import { TContainerNode, TElementContainerNode, TElementNode, TNode } from './interfaces/node';
|
|
14
|
-
import {
|
|
14
|
+
import { LView, TData, TView } from './interfaces/view';
|
|
15
15
|
/**
|
|
16
16
|
* Registers this directive as present in its node's injector by flipping the directive's
|
|
17
17
|
* corresponding bit in the injector's bloom filter.
|
|
@@ -20,7 +20,7 @@ import { LViewData, TData, TView } from './interfaces/view';
|
|
|
20
20
|
* @param tView The TView for the injector's bloom filters
|
|
21
21
|
* @param type The directive token to register
|
|
22
22
|
*/
|
|
23
|
-
export declare function bloomAdd(injectorIndex: number, tView: TView, type: Type<any> | InjectionToken<any>): void;
|
|
23
|
+
export declare function bloomAdd(injectorIndex: number, tView: TView, type: Type<any> | InjectionToken<any> | string): void;
|
|
24
24
|
/**
|
|
25
25
|
* Creates (or gets an existing) injector for a given element or container.
|
|
26
26
|
*
|
|
@@ -28,15 +28,15 @@ export declare function bloomAdd(injectorIndex: number, tView: TView, type: Type
|
|
|
28
28
|
* @param hostView View where the node is stored
|
|
29
29
|
* @returns Node injector
|
|
30
30
|
*/
|
|
31
|
-
export declare function getOrCreateNodeInjectorForNode(tNode: TElementNode | TContainerNode | TElementContainerNode, hostView:
|
|
32
|
-
export declare function getInjectorIndex(tNode: TNode, hostView:
|
|
31
|
+
export declare function getOrCreateNodeInjectorForNode(tNode: TElementNode | TContainerNode | TElementContainerNode, hostView: LView): number;
|
|
32
|
+
export declare function getInjectorIndex(tNode: TNode, hostView: LView): number;
|
|
33
33
|
/**
|
|
34
34
|
* Finds the index of the parent injector, with a view offset if applicable. Used to set the
|
|
35
35
|
* parent injector initially.
|
|
36
36
|
*
|
|
37
37
|
* Returns a combination of number of `ViewData` we have to go up and index in that `Viewdata`
|
|
38
38
|
*/
|
|
39
|
-
export declare function getParentInjectorLocation(tNode: TNode, view:
|
|
39
|
+
export declare function getParentInjectorLocation(tNode: TNode, view: LView): RelativeInjectorLocation;
|
|
40
40
|
/**
|
|
41
41
|
* Makes a type or an injection token public to the DI system by adding it to an
|
|
42
42
|
* injector's bloom filter.
|
|
@@ -44,7 +44,7 @@ export declare function getParentInjectorLocation(tNode: TNode, view: LViewData)
|
|
|
44
44
|
* @param di The node injector in which a directive will be added
|
|
45
45
|
* @param token The type or the injection token to be made public
|
|
46
46
|
*/
|
|
47
|
-
export declare function diPublicInInjector(injectorIndex: number, view:
|
|
47
|
+
export declare function diPublicInInjector(injectorIndex: number, view: LView, token: InjectionToken<any> | Type<any>): void;
|
|
48
48
|
/**
|
|
49
49
|
* Inject static attribute value into directive constructor.
|
|
50
50
|
*
|
|
@@ -83,22 +83,25 @@ export declare function injectAttributeImpl(tNode: TNode, attrNameToInject: stri
|
|
|
83
83
|
* Look for the injector providing the token by walking up the node injector tree and then
|
|
84
84
|
* the module injector tree.
|
|
85
85
|
*
|
|
86
|
-
* @param
|
|
86
|
+
* @param tNode The Node where the search for the injector should start
|
|
87
|
+
* @param lView The `LView` that contains the `tNode`
|
|
87
88
|
* @param token The token to look for
|
|
88
89
|
* @param flags Injection flags
|
|
89
|
-
* @
|
|
90
|
+
* @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`
|
|
91
|
+
* @returns the value from the injector, `null` when not found, or `notFoundValue` if provided
|
|
90
92
|
*/
|
|
91
|
-
export declare function getOrCreateInjectable<T>(tNode: TElementNode | TContainerNode | TElementContainerNode,
|
|
93
|
+
export declare function getOrCreateInjectable<T>(tNode: TElementNode | TContainerNode | TElementContainerNode | null, lView: LView, token: Type<T> | InjectionToken<T>, flags?: InjectFlags, notFoundValue?: any): T | null;
|
|
92
94
|
/**
|
|
93
95
|
* Searches for the given token among the node's directives and providers.
|
|
94
96
|
*
|
|
95
97
|
* @param tNode TNode on which directives are present.
|
|
96
|
-
* @param
|
|
98
|
+
* @param lView The view we are currently processing
|
|
97
99
|
* @param token Provider token or type of a directive to look for.
|
|
98
100
|
* @param canAccessViewProviders Whether view providers should be considered.
|
|
101
|
+
* @param isHostSpecialCase Whether the host special case applies.
|
|
99
102
|
* @returns Index of a found directive or provider, or null when none found.
|
|
100
103
|
*/
|
|
101
|
-
export declare function locateDirectiveOrProvider<T>(tNode: TNode,
|
|
104
|
+
export declare function locateDirectiveOrProvider<T>(tNode: TNode, lView: LView, token: Type<T> | InjectionToken<T>, canAccessViewProviders: boolean, isHostSpecialCase: boolean | number): number | null;
|
|
102
105
|
/**
|
|
103
106
|
* Retrieve or instantiate the injectable from the `lData` at particular `index`.
|
|
104
107
|
*
|
|
@@ -106,7 +109,7 @@ export declare function locateDirectiveOrProvider<T>(tNode: TNode, view: LViewDa
|
|
|
106
109
|
* cached `injectable`. Otherwise if it detects that the value is still a factory it
|
|
107
110
|
* instantiates the `injectable` and caches the value.
|
|
108
111
|
*/
|
|
109
|
-
export declare function getNodeInjectable(tData: TData, lData:
|
|
112
|
+
export declare function getNodeInjectable(tData: TData, lData: LView, index: number, tNode: TElementNode): any;
|
|
110
113
|
/**
|
|
111
114
|
* Returns the bit in an injector's bloom filter that should be used to determine whether or not
|
|
112
115
|
* the directive might be provided by the injector.
|
|
@@ -118,15 +121,14 @@ export declare function getNodeInjectable(tData: TData, lData: LViewData, index:
|
|
|
118
121
|
* @param token the injection token
|
|
119
122
|
* @returns the matching bit to check in the bloom filter or `null` if the token is not known.
|
|
120
123
|
*/
|
|
121
|
-
export declare function bloomHashBitOrFactory(token: Type<any> | InjectionToken<any>): number | Function | undefined;
|
|
122
|
-
export declare function bloomHasToken(bloomHash: number, injectorIndex: number, injectorView:
|
|
124
|
+
export declare function bloomHashBitOrFactory(token: Type<any> | InjectionToken<any> | string): number | Function | undefined;
|
|
125
|
+
export declare function bloomHasToken(bloomHash: number, injectorIndex: number, injectorView: LView | TData): boolean;
|
|
123
126
|
export declare function injectInjector(): NodeInjector;
|
|
124
127
|
export declare class NodeInjector implements Injector {
|
|
125
128
|
private _tNode;
|
|
126
129
|
private _lView;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
get(token: any): any;
|
|
130
|
+
constructor(_tNode: TElementNode | TContainerNode | TElementContainerNode | null, _lView: LView);
|
|
131
|
+
get(token: any, notFoundValue?: any): any;
|
|
130
132
|
}
|
|
131
133
|
export declare function getFactoryOf<T>(type: Type<any>): ((type: Type<T> | null) => T) | null;
|
|
132
134
|
export declare function getInheritedFactory<T>(type: Type<any>): (type: Type<T>) => T;
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Injector } from '../di/injector';
|
|
9
9
|
import { LContext } from './interfaces/context';
|
|
10
|
-
import {
|
|
10
|
+
import { LView, RootContext } from './interfaces/view';
|
|
11
11
|
/**
|
|
12
12
|
* Returns the component instance associated with a given DOM host element.
|
|
13
13
|
* Elements which don't represent components return `null`.
|
|
14
14
|
*
|
|
15
|
-
* @param element Host DOM element from which the component should be retrieved
|
|
15
|
+
* @param element Host DOM element from which the component should be retrieved.
|
|
16
16
|
*
|
|
17
17
|
* ```
|
|
18
18
|
* <my-app>
|
|
@@ -29,6 +29,27 @@ import { LViewData, RootContext } from './interfaces/view';
|
|
|
29
29
|
* @publicApi
|
|
30
30
|
*/
|
|
31
31
|
export declare function getComponent<T = {}>(element: Element): T | null;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the component instance associated with a given DOM host element.
|
|
34
|
+
* Elements which don't represent components return `null`.
|
|
35
|
+
*
|
|
36
|
+
* @param element Host DOM element from which the component should be retrieved.
|
|
37
|
+
*
|
|
38
|
+
* ```
|
|
39
|
+
* <my-app>
|
|
40
|
+
* #VIEW
|
|
41
|
+
* <div>
|
|
42
|
+
* <child-comp></child-comp>
|
|
43
|
+
* </div>
|
|
44
|
+
* </mp-app>
|
|
45
|
+
*
|
|
46
|
+
* expect(getComponent(<child-comp>) instanceof ChildComponent).toBeTruthy();
|
|
47
|
+
* expect(getComponent(<my-app>) instanceof MyApp).toBeTruthy();
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @publicApi
|
|
51
|
+
*/
|
|
52
|
+
export declare function getContext<T = {}>(element: Element): T | null;
|
|
32
53
|
/**
|
|
33
54
|
* Returns the component instance associated with view which owns the DOM element (`null`
|
|
34
55
|
* otherwise).
|
|
@@ -55,7 +76,7 @@ export declare function getViewComponent<T = {}>(element: Element | {}): T | nul
|
|
|
55
76
|
* the application where the target is situated.
|
|
56
77
|
*
|
|
57
78
|
*/
|
|
58
|
-
export declare function getRootContext(target:
|
|
79
|
+
export declare function getRootContext(target: LView | {}): RootContext;
|
|
59
80
|
/**
|
|
60
81
|
* Retrieve all root components.
|
|
61
82
|
*
|
|
@@ -74,6 +95,13 @@ export declare function getRootComponents(target: {}): any[];
|
|
|
74
95
|
* @publicApi
|
|
75
96
|
*/
|
|
76
97
|
export declare function getInjector(target: {}): Injector;
|
|
98
|
+
/**
|
|
99
|
+
* Retrieve a set of injection tokens at a given DOM node.
|
|
100
|
+
*
|
|
101
|
+
* @param element Element for which the injection tokens should be retrieved.
|
|
102
|
+
* @publicApi
|
|
103
|
+
*/
|
|
104
|
+
export declare function getInjectionTokens(element: Element): any[];
|
|
77
105
|
/**
|
|
78
106
|
* Retrieves directives associated with a given DOM host element.
|
|
79
107
|
*
|
|
@@ -87,16 +115,16 @@ export declare function getDirectives(target: {}): Array<{}>;
|
|
|
87
115
|
* Throws if a given target doesn't have associated LContext.
|
|
88
116
|
*
|
|
89
117
|
*/
|
|
90
|
-
export declare function
|
|
91
|
-
export declare function
|
|
118
|
+
export declare function loadLContext(target: {}): LContext;
|
|
119
|
+
export declare function loadLContext(target: {}, throwOnNotFound: false): LContext | null;
|
|
92
120
|
/**
|
|
93
|
-
* Retrieve the root view from any component by walking the parent `
|
|
94
|
-
* reaching the root `
|
|
121
|
+
* Retrieve the root view from any component by walking the parent `LView` until
|
|
122
|
+
* reaching the root `LView`.
|
|
95
123
|
*
|
|
96
124
|
* @param componentOrView any component or view
|
|
97
125
|
*
|
|
98
126
|
*/
|
|
99
|
-
export declare function getRootView(componentOrView:
|
|
127
|
+
export declare function getRootView(componentOrView: LView | {}): LView;
|
|
100
128
|
/**
|
|
101
129
|
* Retrieve map of local references.
|
|
102
130
|
*
|
|
@@ -131,3 +159,33 @@ export declare function getHostElement<T>(directive: T): Element;
|
|
|
131
159
|
* @param component The component to return the content text for.
|
|
132
160
|
*/
|
|
133
161
|
export declare function getRenderedText(component: any): string;
|
|
162
|
+
export declare function loadLContextFromNode(node: Node): LContext;
|
|
163
|
+
export interface Listener {
|
|
164
|
+
name: string;
|
|
165
|
+
element: Element;
|
|
166
|
+
callback: (value: any) => any;
|
|
167
|
+
useCapture: boolean | null;
|
|
168
|
+
}
|
|
169
|
+
export declare function isBrowserEvents(listener: Listener): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Retrieves a list of DOM listeners.
|
|
172
|
+
*
|
|
173
|
+
* ```
|
|
174
|
+
* <my-app>
|
|
175
|
+
* #VIEW
|
|
176
|
+
* <div (click)="doSomething()">
|
|
177
|
+
* </div>
|
|
178
|
+
* </mp-app>
|
|
179
|
+
*
|
|
180
|
+
* expect(getListeners(<div>)).toEqual({
|
|
181
|
+
* name: 'click',
|
|
182
|
+
* element: <div>,
|
|
183
|
+
* callback: () => doSomething(),
|
|
184
|
+
* useCapture: false
|
|
185
|
+
* });
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @param element Element for which the DOM listeners should be retrieved.
|
|
189
|
+
* @publicApi
|
|
190
|
+
*/
|
|
191
|
+
export declare function getListeners(element: Element): Listener[];
|