@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/fesm5/testing.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v7.2.0
|
|
2
|
+
* @license Angular v7.2.0
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { RendererFactory2, getDebugNode, ɵstringify, Component, Directive, NgModule, Pipe, ɵReflectionCapabilities, InjectionToken, Injector, NgZone, ɵRender3ComponentFactory, ɵRender3NgModuleRef, ɵcompileComponent, ɵcompileDirective, ɵcompileNgModuleDefs, ɵcompilePipe, ɵgetInjectableDef, ɵpatchComponentDefWithScope, Compiler, Injectable,
|
|
8
|
-
import { __spread, __decorate,
|
|
7
|
+
import { RendererFactory2, getDebugNode, ɵstringify, Component, Directive, NgModule, Pipe, ɵReflectionCapabilities, InjectionToken, ApplicationInitStatus, Injector, NgZone, resolveForwardRef, ɵRender3ComponentFactory, ɵRender3NgModuleRef, ɵcompileComponent, ɵcompileDirective, ɵcompileNgModuleDefs, ɵcompilePipe, ɵgetInjectableDef, ɵpatchComponentDefWithScope, ɵresetCompiledComponents, Compiler, Injectable, Optional, SkipSelf, ɵAPP_ROOT, ɵclearOverrides, ɵivyEnabled, ɵoverrideComponentView, ɵoverrideProvider } from '@angular/core';
|
|
8
|
+
import { __spread, __decorate, __assign, __values, __read, __extends } from 'tslib';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @license
|
|
@@ -764,7 +764,9 @@ var OverrideResolver = /** @class */ (function () {
|
|
|
764
764
|
this.overrides.clear();
|
|
765
765
|
overrides.forEach(function (_a) {
|
|
766
766
|
var _b = __read(_a, 2), type = _b[0], override = _b[1];
|
|
767
|
-
|
|
767
|
+
var overrides = _this.overrides.get(type) || [];
|
|
768
|
+
overrides.push(override);
|
|
769
|
+
_this.overrides.set(type, overrides);
|
|
768
770
|
});
|
|
769
771
|
};
|
|
770
772
|
OverrideResolver.prototype.getAnnotation = function (type) {
|
|
@@ -772,14 +774,17 @@ var OverrideResolver = /** @class */ (function () {
|
|
|
772
774
|
return reflection.annotations(type).find(function (a) { return a instanceof _this.type; }) || null;
|
|
773
775
|
};
|
|
774
776
|
OverrideResolver.prototype.resolve = function (type) {
|
|
777
|
+
var _this = this;
|
|
775
778
|
var resolved = this.resolved.get(type) || null;
|
|
776
779
|
if (!resolved) {
|
|
777
780
|
resolved = this.getAnnotation(type);
|
|
778
781
|
if (resolved) {
|
|
779
|
-
var
|
|
780
|
-
if (
|
|
781
|
-
var
|
|
782
|
-
|
|
782
|
+
var overrides = this.overrides.get(type);
|
|
783
|
+
if (overrides) {
|
|
784
|
+
var overrider_1 = new MetadataOverrider();
|
|
785
|
+
overrides.forEach(function (override) {
|
|
786
|
+
resolved = overrider_1.overrideMetadata(_this.type, resolved, override);
|
|
787
|
+
});
|
|
783
788
|
}
|
|
784
789
|
}
|
|
785
790
|
this.resolved.set(type, resolved);
|
|
@@ -872,6 +877,7 @@ var ComponentFixtureNoNgZone = new InjectionToken('ComponentFixtureNoNgZone');
|
|
|
872
877
|
* found in the LICENSE file at https://angular.io/license
|
|
873
878
|
*/
|
|
874
879
|
var _nextRootElementId = 0;
|
|
880
|
+
var EMPTY_ARRAY = [];
|
|
875
881
|
/**
|
|
876
882
|
* @description
|
|
877
883
|
* Configures and initializes environment for unit testing and provides methods for
|
|
@@ -894,6 +900,8 @@ var TestBedRender3 = /** @class */ (function () {
|
|
|
894
900
|
this._pipeOverrides = [];
|
|
895
901
|
this._providerOverrides = [];
|
|
896
902
|
this._rootProviderOverrides = [];
|
|
903
|
+
this._providerOverridesByToken = new Map();
|
|
904
|
+
this._templateOverrides = new Map();
|
|
897
905
|
// test module configuration
|
|
898
906
|
this._providers = [];
|
|
899
907
|
this._declarations = [];
|
|
@@ -901,6 +909,7 @@ var TestBedRender3 = /** @class */ (function () {
|
|
|
901
909
|
this._schemas = [];
|
|
902
910
|
this._activeFixtures = [];
|
|
903
911
|
this._moduleRef = null;
|
|
912
|
+
this._testModuleType = null;
|
|
904
913
|
this._instantiated = false;
|
|
905
914
|
}
|
|
906
915
|
/**
|
|
@@ -976,7 +985,10 @@ var TestBedRender3 = /** @class */ (function () {
|
|
|
976
985
|
return TestBedRender3;
|
|
977
986
|
};
|
|
978
987
|
TestBedRender3.prototype.overrideTemplateUsingTestingModule = function (component, template) {
|
|
979
|
-
|
|
988
|
+
if (this._instantiated) {
|
|
989
|
+
throw new Error('Cannot override template when the test module has already been instantiated');
|
|
990
|
+
}
|
|
991
|
+
this._templateOverrides.set(component, template);
|
|
980
992
|
};
|
|
981
993
|
TestBedRender3.overrideProvider = function (token, provider) {
|
|
982
994
|
_getTestBedRender3().overrideProvider(token, provider);
|
|
@@ -1027,6 +1039,7 @@ var TestBedRender3 = /** @class */ (function () {
|
|
|
1027
1039
|
this.ngModule = null;
|
|
1028
1040
|
};
|
|
1029
1041
|
TestBedRender3.prototype.resetTestingModule = function () {
|
|
1042
|
+
ɵresetCompiledComponents();
|
|
1030
1043
|
// reset metadata overrides
|
|
1031
1044
|
this._moduleOverrides = [];
|
|
1032
1045
|
this._componentOverrides = [];
|
|
@@ -1034,12 +1047,15 @@ var TestBedRender3 = /** @class */ (function () {
|
|
|
1034
1047
|
this._pipeOverrides = [];
|
|
1035
1048
|
this._providerOverrides = [];
|
|
1036
1049
|
this._rootProviderOverrides = [];
|
|
1050
|
+
this._providerOverridesByToken.clear();
|
|
1051
|
+
this._templateOverrides.clear();
|
|
1037
1052
|
// reset test module config
|
|
1038
1053
|
this._providers = [];
|
|
1039
1054
|
this._declarations = [];
|
|
1040
1055
|
this._imports = [];
|
|
1041
1056
|
this._schemas = [];
|
|
1042
1057
|
this._moduleRef = null;
|
|
1058
|
+
this._testModuleType = null;
|
|
1043
1059
|
this._instantiated = false;
|
|
1044
1060
|
this._activeFixtures.forEach(function (fixture) {
|
|
1045
1061
|
try {
|
|
@@ -1118,16 +1134,18 @@ var TestBedRender3 = /** @class */ (function () {
|
|
|
1118
1134
|
* Overwrites all providers for the given token with the given provider definition.
|
|
1119
1135
|
*/
|
|
1120
1136
|
TestBedRender3.prototype.overrideProvider = function (token, provider) {
|
|
1137
|
+
var providerDef = provider.useFactory ?
|
|
1138
|
+
{ provide: token, useFactory: provider.useFactory, deps: provider.deps || [] } :
|
|
1139
|
+
{ provide: token, useValue: provider.useValue };
|
|
1121
1140
|
var injectableDef;
|
|
1122
1141
|
var isRoot = (typeof token !== 'string' && (injectableDef = ɵgetInjectableDef(token)) &&
|
|
1123
1142
|
injectableDef.providedIn === 'root');
|
|
1124
|
-
var
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
}
|
|
1143
|
+
var overridesBucket = isRoot ? this._rootProviderOverrides : this._providerOverrides;
|
|
1144
|
+
overridesBucket.push(providerDef);
|
|
1145
|
+
// keep all overrides grouped by token as well for fast lookups using token
|
|
1146
|
+
var overridesForToken = this._providerOverridesByToken.get(token) || [];
|
|
1147
|
+
overridesForToken.push(providerDef);
|
|
1148
|
+
this._providerOverridesByToken.set(token, overridesForToken);
|
|
1131
1149
|
};
|
|
1132
1150
|
TestBedRender3.prototype.deprecatedOverrideProvider = function (token, provider) {
|
|
1133
1151
|
throw new Error('No implemented in IVY');
|
|
@@ -1160,12 +1178,22 @@ var TestBedRender3 = /** @class */ (function () {
|
|
|
1160
1178
|
return;
|
|
1161
1179
|
}
|
|
1162
1180
|
var resolvers = this._getResolvers();
|
|
1163
|
-
|
|
1164
|
-
|
|
1181
|
+
this._testModuleType = this._createTestModule();
|
|
1182
|
+
this._compileNgModule(this._testModuleType, resolvers);
|
|
1165
1183
|
var parentInjector = this.platform.injector;
|
|
1166
|
-
this._moduleRef = new ɵRender3NgModuleRef(
|
|
1184
|
+
this._moduleRef = new ɵRender3NgModuleRef(this._testModuleType, parentInjector);
|
|
1185
|
+
// ApplicationInitStatus.runInitializers() is marked @internal
|
|
1186
|
+
// to core. Cast it to any before accessing it.
|
|
1187
|
+
this._moduleRef.injector.get(ApplicationInitStatus).runInitializers();
|
|
1167
1188
|
this._instantiated = true;
|
|
1168
1189
|
};
|
|
1190
|
+
// get overrides for a specific provider (if any)
|
|
1191
|
+
TestBedRender3.prototype._getProviderOverrides = function (provider) {
|
|
1192
|
+
var token = typeof provider === 'object' && provider.hasOwnProperty('provide') ?
|
|
1193
|
+
provider.provide :
|
|
1194
|
+
provider;
|
|
1195
|
+
return this._providerOverridesByToken.get(token) || [];
|
|
1196
|
+
};
|
|
1169
1197
|
// creates resolvers taking overrides into account
|
|
1170
1198
|
TestBedRender3.prototype._getResolvers = function () {
|
|
1171
1199
|
var module = new NgModuleResolver();
|
|
@@ -1212,128 +1240,155 @@ var TestBedRender3 = /** @class */ (function () {
|
|
|
1212
1240
|
}());
|
|
1213
1241
|
return DynamicTestModule;
|
|
1214
1242
|
};
|
|
1243
|
+
TestBedRender3.prototype._getMetaWithOverrides = function (meta, type) {
|
|
1244
|
+
var _this = this;
|
|
1245
|
+
var overrides = {};
|
|
1246
|
+
if (meta.providers && meta.providers.length) {
|
|
1247
|
+
var providerOverrides = flatten(meta.providers, function (provider) { return _this._getProviderOverrides(provider); });
|
|
1248
|
+
if (providerOverrides.length) {
|
|
1249
|
+
overrides.providers = __spread(meta.providers, providerOverrides);
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
var hasTemplateOverride = !!type && this._templateOverrides.has(type);
|
|
1253
|
+
if (hasTemplateOverride) {
|
|
1254
|
+
overrides.template = this._templateOverrides.get(type);
|
|
1255
|
+
}
|
|
1256
|
+
return Object.keys(overrides).length ? __assign({}, meta, overrides) : meta;
|
|
1257
|
+
};
|
|
1258
|
+
TestBedRender3.prototype._compileNgModule = function (moduleType, resolvers) {
|
|
1259
|
+
var _this = this;
|
|
1260
|
+
var ngModule = resolvers.module.resolve(moduleType);
|
|
1261
|
+
if (ngModule === null) {
|
|
1262
|
+
throw new Error(ɵstringify(moduleType) + " has not @NgModule annotation");
|
|
1263
|
+
}
|
|
1264
|
+
var metadata = this._getMetaWithOverrides(ngModule);
|
|
1265
|
+
ɵcompileNgModuleDefs(moduleType, metadata);
|
|
1266
|
+
var declarations = flatten(ngModule.declarations || EMPTY_ARRAY, resolveForwardRef);
|
|
1267
|
+
var compiledComponents = [];
|
|
1268
|
+
// Compile the components, directives and pipes declared by this module
|
|
1269
|
+
declarations.forEach(function (declaration) {
|
|
1270
|
+
var component = resolvers.component.resolve(declaration);
|
|
1271
|
+
if (component) {
|
|
1272
|
+
var metadata_1 = _this._getMetaWithOverrides(component, declaration);
|
|
1273
|
+
ɵcompileComponent(declaration, metadata_1);
|
|
1274
|
+
compiledComponents.push(declaration);
|
|
1275
|
+
return;
|
|
1276
|
+
}
|
|
1277
|
+
var directive = resolvers.directive.resolve(declaration);
|
|
1278
|
+
if (directive) {
|
|
1279
|
+
var metadata_2 = _this._getMetaWithOverrides(directive);
|
|
1280
|
+
ɵcompileDirective(declaration, metadata_2);
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1283
|
+
var pipe = resolvers.pipe.resolve(declaration);
|
|
1284
|
+
if (pipe) {
|
|
1285
|
+
ɵcompilePipe(declaration, pipe);
|
|
1286
|
+
return;
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
// Compile transitive modules, components, directives and pipes
|
|
1290
|
+
var transitiveScope = this._transitiveScopesFor(moduleType, resolvers);
|
|
1291
|
+
compiledComponents.forEach(function (cmp) {
|
|
1292
|
+
var scope = _this._templateOverrides.has(cmp) ?
|
|
1293
|
+
// if we have template override via `TestBed.overrideTemplateUsingTestingModule` -
|
|
1294
|
+
// define Component scope as TestingModule scope, instead of the scope of NgModule
|
|
1295
|
+
// where this Component was declared
|
|
1296
|
+
_this._transitiveScopesFor(_this._testModuleType, resolvers) :
|
|
1297
|
+
transitiveScope;
|
|
1298
|
+
ɵpatchComponentDefWithScope(cmp.ngComponentDef, scope);
|
|
1299
|
+
});
|
|
1300
|
+
};
|
|
1301
|
+
/**
|
|
1302
|
+
* Compute the pair of transitive scopes (compilation scope and exported scope) for a given
|
|
1303
|
+
* module.
|
|
1304
|
+
*
|
|
1305
|
+
* This operation is memoized and the result is cached on the module's definition. It can be
|
|
1306
|
+
* called on modules with components that have not fully compiled yet, but the result should not
|
|
1307
|
+
* be used until they have.
|
|
1308
|
+
*/
|
|
1309
|
+
TestBedRender3.prototype._transitiveScopesFor = function (moduleType, resolvers) {
|
|
1310
|
+
var _this = this;
|
|
1311
|
+
if (!isNgModule(moduleType)) {
|
|
1312
|
+
throw new Error(moduleType.name + " does not have an ngModuleDef");
|
|
1313
|
+
}
|
|
1314
|
+
var def = moduleType.ngModuleDef;
|
|
1315
|
+
if (def.transitiveCompileScopes !== null) {
|
|
1316
|
+
return def.transitiveCompileScopes;
|
|
1317
|
+
}
|
|
1318
|
+
var scopes = {
|
|
1319
|
+
compilation: {
|
|
1320
|
+
directives: new Set(),
|
|
1321
|
+
pipes: new Set(),
|
|
1322
|
+
},
|
|
1323
|
+
exported: {
|
|
1324
|
+
directives: new Set(),
|
|
1325
|
+
pipes: new Set(),
|
|
1326
|
+
},
|
|
1327
|
+
};
|
|
1328
|
+
def.declarations.forEach(function (declared) {
|
|
1329
|
+
var declaredWithDefs = declared;
|
|
1330
|
+
if (declaredWithDefs.ngPipeDef !== undefined) {
|
|
1331
|
+
scopes.compilation.pipes.add(declared);
|
|
1332
|
+
}
|
|
1333
|
+
else {
|
|
1334
|
+
scopes.compilation.directives.add(declared);
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
def.imports.forEach(function (imported) {
|
|
1338
|
+
var ngModule = resolvers.module.resolve(imported);
|
|
1339
|
+
if (ngModule === null) {
|
|
1340
|
+
throw new Error("Importing " + imported.name + " which does not have an @ngModule");
|
|
1341
|
+
}
|
|
1342
|
+
else {
|
|
1343
|
+
_this._compileNgModule(imported, resolvers);
|
|
1344
|
+
}
|
|
1345
|
+
// When this module imports another, the imported module's exported directives and pipes are
|
|
1346
|
+
// added to the compilation scope of this module.
|
|
1347
|
+
var importedScope = _this._transitiveScopesFor(imported, resolvers);
|
|
1348
|
+
importedScope.exported.directives.forEach(function (entry) { return scopes.compilation.directives.add(entry); });
|
|
1349
|
+
importedScope.exported.pipes.forEach(function (entry) { return scopes.compilation.pipes.add(entry); });
|
|
1350
|
+
});
|
|
1351
|
+
def.exports.forEach(function (exported) {
|
|
1352
|
+
var exportedTyped = exported;
|
|
1353
|
+
// Either the type is a module, a pipe, or a component/directive (which may not have an
|
|
1354
|
+
// ngComponentDef as it might be compiled asynchronously).
|
|
1355
|
+
if (isNgModule(exportedTyped)) {
|
|
1356
|
+
// When this module exports another, the exported module's exported directives and pipes are
|
|
1357
|
+
// added to both the compilation and exported scopes of this module.
|
|
1358
|
+
var exportedScope = _this._transitiveScopesFor(exportedTyped, resolvers);
|
|
1359
|
+
exportedScope.exported.directives.forEach(function (entry) {
|
|
1360
|
+
scopes.compilation.directives.add(entry);
|
|
1361
|
+
scopes.exported.directives.add(entry);
|
|
1362
|
+
});
|
|
1363
|
+
exportedScope.exported.pipes.forEach(function (entry) {
|
|
1364
|
+
scopes.compilation.pipes.add(entry);
|
|
1365
|
+
scopes.exported.pipes.add(entry);
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
else if (exportedTyped.ngPipeDef !== undefined) {
|
|
1369
|
+
scopes.exported.pipes.add(exportedTyped);
|
|
1370
|
+
}
|
|
1371
|
+
else {
|
|
1372
|
+
scopes.exported.directives.add(exportedTyped);
|
|
1373
|
+
}
|
|
1374
|
+
});
|
|
1375
|
+
def.transitiveCompileScopes = scopes;
|
|
1376
|
+
return scopes;
|
|
1377
|
+
};
|
|
1215
1378
|
return TestBedRender3;
|
|
1216
1379
|
}());
|
|
1217
1380
|
var testBed;
|
|
1218
1381
|
function _getTestBedRender3() {
|
|
1219
1382
|
return testBed = testBed || new TestBedRender3();
|
|
1220
1383
|
}
|
|
1221
|
-
|
|
1222
|
-
var EMPTY_ARRAY = [];
|
|
1223
|
-
function compileNgModule(moduleType, resolvers) {
|
|
1224
|
-
var ngModule = resolvers.module.resolve(moduleType);
|
|
1225
|
-
if (ngModule === null) {
|
|
1226
|
-
throw new Error(ɵstringify(moduleType) + " has not @NgModule annotation");
|
|
1227
|
-
}
|
|
1228
|
-
ɵcompileNgModuleDefs(moduleType, ngModule);
|
|
1229
|
-
var declarations = flatten(ngModule.declarations || EMPTY_ARRAY);
|
|
1230
|
-
var compiledComponents = [];
|
|
1231
|
-
// Compile the components, directives and pipes declared by this module
|
|
1232
|
-
declarations.forEach(function (declaration) {
|
|
1233
|
-
var component = resolvers.component.resolve(declaration);
|
|
1234
|
-
if (component) {
|
|
1235
|
-
ɵcompileComponent(declaration, component);
|
|
1236
|
-
compiledComponents.push(declaration);
|
|
1237
|
-
return;
|
|
1238
|
-
}
|
|
1239
|
-
var directive = resolvers.directive.resolve(declaration);
|
|
1240
|
-
if (directive) {
|
|
1241
|
-
ɵcompileDirective(declaration, directive);
|
|
1242
|
-
return;
|
|
1243
|
-
}
|
|
1244
|
-
var pipe = resolvers.pipe.resolve(declaration);
|
|
1245
|
-
if (pipe) {
|
|
1246
|
-
ɵcompilePipe(declaration, pipe);
|
|
1247
|
-
return;
|
|
1248
|
-
}
|
|
1249
|
-
});
|
|
1250
|
-
// Compile transitive modules, components, directives and pipes
|
|
1251
|
-
var transitiveScope = transitiveScopesFor(moduleType, resolvers);
|
|
1252
|
-
compiledComponents.forEach(function (cmp) { return ɵpatchComponentDefWithScope(cmp.ngComponentDef, transitiveScope); });
|
|
1253
|
-
}
|
|
1254
|
-
/**
|
|
1255
|
-
* Compute the pair of transitive scopes (compilation scope and exported scope) for a given module.
|
|
1256
|
-
*
|
|
1257
|
-
* This operation is memoized and the result is cached on the module's definition. It can be called
|
|
1258
|
-
* on modules with components that have not fully compiled yet, but the result should not be used
|
|
1259
|
-
* until they have.
|
|
1260
|
-
*/
|
|
1261
|
-
function transitiveScopesFor(moduleType, resolvers) {
|
|
1262
|
-
if (!isNgModule(moduleType)) {
|
|
1263
|
-
throw new Error(moduleType.name + " does not have an ngModuleDef");
|
|
1264
|
-
}
|
|
1265
|
-
var def = moduleType.ngModuleDef;
|
|
1266
|
-
if (def.transitiveCompileScopes !== null) {
|
|
1267
|
-
return def.transitiveCompileScopes;
|
|
1268
|
-
}
|
|
1269
|
-
var scopes = {
|
|
1270
|
-
compilation: {
|
|
1271
|
-
directives: new Set(),
|
|
1272
|
-
pipes: new Set(),
|
|
1273
|
-
},
|
|
1274
|
-
exported: {
|
|
1275
|
-
directives: new Set(),
|
|
1276
|
-
pipes: new Set(),
|
|
1277
|
-
},
|
|
1278
|
-
};
|
|
1279
|
-
def.declarations.forEach(function (declared) {
|
|
1280
|
-
var declaredWithDefs = declared;
|
|
1281
|
-
if (declaredWithDefs.ngPipeDef !== undefined) {
|
|
1282
|
-
scopes.compilation.pipes.add(declared);
|
|
1283
|
-
}
|
|
1284
|
-
else {
|
|
1285
|
-
scopes.compilation.directives.add(declared);
|
|
1286
|
-
}
|
|
1287
|
-
});
|
|
1288
|
-
def.imports.forEach(function (imported) {
|
|
1289
|
-
var ngModule = resolvers.module.resolve(imported);
|
|
1290
|
-
if (ngModule === null) {
|
|
1291
|
-
throw new Error("Importing " + imported.name + " which does not have an @ngModule");
|
|
1292
|
-
}
|
|
1293
|
-
else {
|
|
1294
|
-
compileNgModule(imported, resolvers);
|
|
1295
|
-
}
|
|
1296
|
-
// When this module imports another, the imported module's exported directives and pipes are
|
|
1297
|
-
// added to the compilation scope of this module.
|
|
1298
|
-
var importedScope = transitiveScopesFor(imported, resolvers);
|
|
1299
|
-
importedScope.exported.directives.forEach(function (entry) { return scopes.compilation.directives.add(entry); });
|
|
1300
|
-
importedScope.exported.pipes.forEach(function (entry) { return scopes.compilation.pipes.add(entry); });
|
|
1301
|
-
});
|
|
1302
|
-
def.exports.forEach(function (exported) {
|
|
1303
|
-
var exportedTyped = exported;
|
|
1304
|
-
// Either the type is a module, a pipe, or a component/directive (which may not have an
|
|
1305
|
-
// ngComponentDef as it might be compiled asynchronously).
|
|
1306
|
-
if (isNgModule(exportedTyped)) {
|
|
1307
|
-
// When this module exports another, the exported module's exported directives and pipes are
|
|
1308
|
-
// added to both the compilation and exported scopes of this module.
|
|
1309
|
-
var exportedScope = transitiveScopesFor(exportedTyped, resolvers);
|
|
1310
|
-
exportedScope.exported.directives.forEach(function (entry) {
|
|
1311
|
-
scopes.compilation.directives.add(entry);
|
|
1312
|
-
scopes.exported.directives.add(entry);
|
|
1313
|
-
});
|
|
1314
|
-
exportedScope.exported.pipes.forEach(function (entry) {
|
|
1315
|
-
scopes.compilation.pipes.add(entry);
|
|
1316
|
-
scopes.exported.pipes.add(entry);
|
|
1317
|
-
});
|
|
1318
|
-
}
|
|
1319
|
-
else if (exportedTyped.ngPipeDef !== undefined) {
|
|
1320
|
-
scopes.exported.pipes.add(exportedTyped);
|
|
1321
|
-
}
|
|
1322
|
-
else {
|
|
1323
|
-
scopes.exported.directives.add(exportedTyped);
|
|
1324
|
-
}
|
|
1325
|
-
});
|
|
1326
|
-
def.transitiveCompileScopes = scopes;
|
|
1327
|
-
return scopes;
|
|
1328
|
-
}
|
|
1329
|
-
function flatten(values) {
|
|
1384
|
+
function flatten(values, mapFn) {
|
|
1330
1385
|
var out = [];
|
|
1331
1386
|
values.forEach(function (value) {
|
|
1332
1387
|
if (Array.isArray(value)) {
|
|
1333
|
-
out.push.apply(out, __spread(flatten(value)));
|
|
1388
|
+
out.push.apply(out, __spread(flatten(value, mapFn)));
|
|
1334
1389
|
}
|
|
1335
1390
|
else {
|
|
1336
|
-
out.push(value);
|
|
1391
|
+
out.push(mapFn ? mapFn(value) : value);
|
|
1337
1392
|
}
|
|
1338
1393
|
});
|
|
1339
1394
|
return out;
|