@angular/core 2.0.0-rc.1 → 2.0.0-rc.2
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/{core.umd.js → bundles/core.umd.js} +6402 -4606
- package/bundles/core.umd.min.js +6 -0
- package/esm/index.d.ts +5 -4
- package/esm/index.js +9 -8
- package/esm/index.js.map +1 -1
- package/esm/private_export.d.ts +96 -11
- package/esm/private_export.js +39 -10
- package/esm/private_export.js.map +1 -1
- package/esm/private_export.metadata.json +1 -1
- package/esm/src/animation/active_animation_players_map.d.ts +11 -0
- package/esm/src/animation/active_animation_players_map.js +47 -0
- package/esm/src/animation/active_animation_players_map.js.map +1 -0
- package/esm/src/animation/animation_constants.d.ts +4 -0
- package/esm/src/animation/animation_constants.js +5 -0
- package/esm/src/animation/animation_constants.js.map +1 -0
- package/esm/src/animation/animation_constants.metadata.json +1 -0
- package/esm/src/animation/animation_driver.d.ts +9 -0
- package/esm/src/animation/animation_driver.js +9 -0
- package/esm/src/animation/animation_driver.js.map +1 -0
- package/esm/src/animation/animation_group_player.d.ts +18 -0
- package/esm/src/animation/animation_group_player.js +60 -0
- package/esm/src/animation/animation_group_player.js.map +1 -0
- package/esm/src/animation/animation_keyframe.d.ts +6 -0
- package/esm/src/animation/animation_keyframe.js +7 -0
- package/esm/src/animation/animation_keyframe.js.map +1 -0
- package/esm/src/animation/animation_player.d.ts +26 -0
- package/esm/src/animation/animation_player.js +30 -0
- package/esm/src/animation/animation_player.js.map +1 -0
- package/esm/src/animation/animation_sequence_player.d.ts +21 -0
- package/esm/src/animation/animation_sequence_player.js +64 -0
- package/esm/src/animation/animation_sequence_player.js.map +1 -0
- package/esm/src/animation/animation_style_util.d.ts +32 -0
- package/esm/src/animation/animation_style_util.js +91 -0
- package/esm/src/animation/animation_style_util.js.map +1 -0
- package/esm/src/animation/animation_style_util.metadata.json +1 -0
- package/esm/src/animation/animation_styles.d.ts +8 -0
- package/esm/src/animation/animation_styles.js +6 -0
- package/esm/src/animation/animation_styles.js.map +1 -0
- package/esm/src/animation/metadata.d.ts +511 -0
- package/esm/src/animation/metadata.js +565 -0
- package/esm/src/animation/metadata.js.map +1 -0
- package/esm/src/animation/metadata.metadata.json +1 -0
- package/esm/src/application_common_providers.d.ts +1 -0
- package/esm/src/application_common_providers.js +5 -4
- package/esm/src/application_common_providers.js.map +1 -1
- package/esm/src/application_common_providers.metadata.json +1 -1
- package/esm/src/application_ref.d.ts +17 -41
- package/esm/src/application_ref.js +32 -23
- package/esm/src/application_ref.js.map +1 -1
- package/esm/src/application_ref.metadata.json +1 -1
- package/esm/src/application_tokens.d.ts +6 -1
- package/esm/src/application_tokens.js +9 -4
- package/esm/src/application_tokens.js.map +1 -1
- package/esm/src/application_tokens.metadata.json +1 -1
- package/esm/src/change_detection/change_detection.d.ts +9 -8
- package/esm/src/change_detection/change_detection.js +7 -7
- package/esm/src/change_detection/change_detection.js.map +1 -1
- package/esm/src/change_detection/change_detection.metadata.json +1 -1
- package/esm/src/change_detection/change_detection_util.d.ts +3 -1
- package/esm/src/change_detection/change_detection_util.js +6 -5
- package/esm/src/change_detection/change_detection_util.js.map +1 -1
- package/esm/src/change_detection/change_detection_util.metadata.json +1 -1
- package/esm/src/change_detection/change_detector_ref.d.ts +3 -0
- package/esm/src/change_detection/change_detector_ref.js +3 -0
- package/esm/src/change_detection/change_detector_ref.js.map +1 -1
- package/esm/src/change_detection/constants.d.ts +1 -0
- package/esm/src/change_detection/constants.js +4 -3
- package/esm/src/change_detection/constants.js.map +1 -1
- package/esm/src/change_detection/constants.metadata.json +1 -1
- package/esm/src/change_detection/differs/default_iterable_differ.d.ts +6 -94
- package/esm/src/change_detection/differs/default_iterable_differ.js +25 -18
- package/esm/src/change_detection/differs/default_iterable_differ.js.map +1 -1
- package/esm/src/change_detection/differs/default_keyvalue_differ.d.ts +3 -30
- package/esm/src/change_detection/differs/default_keyvalue_differ.js +13 -8
- package/esm/src/change_detection/differs/default_keyvalue_differ.js.map +1 -1
- package/esm/src/change_detection/differs/iterable_differs.d.ts +4 -1
- package/esm/src/change_detection/differs/iterable_differs.js +5 -4
- package/esm/src/change_detection/differs/iterable_differs.js.map +1 -1
- package/esm/src/change_detection/differs/keyvalue_differs.d.ts +2 -1
- package/esm/src/change_detection/differs/keyvalue_differs.js +5 -4
- package/esm/src/change_detection/differs/keyvalue_differs.js.map +1 -1
- package/esm/src/change_detection/pipe_transform.js.map +1 -1
- package/esm/src/change_detection.d.ts +1 -1
- package/esm/src/change_detection.js +5 -5
- package/esm/src/change_detection.js.map +1 -1
- package/esm/src/console.js +2 -1
- package/esm/src/console.js.map +1 -1
- package/esm/src/console.metadata.json +1 -1
- package/esm/src/debug/debug_node.d.ts +20 -2
- package/esm/src/debug/debug_node.js +16 -2
- package/esm/src/debug/debug_node.js.map +1 -1
- package/esm/src/debug/debug_node.metadata.json +1 -0
- package/esm/src/debug/debug_renderer.d.ts +10 -6
- package/esm/src/debug/debug_renderer.js +13 -2
- package/esm/src/debug/debug_renderer.js.map +1 -1
- package/esm/src/di/decorators.d.ts +13 -1
- package/esm/src/di/decorators.js +7 -1
- package/esm/src/di/decorators.js.map +1 -1
- package/esm/src/di/decorators.metadata.json +1 -1
- package/esm/src/di/forward_ref.d.ts +3 -1
- package/esm/src/di/forward_ref.js +3 -1
- package/esm/src/di/forward_ref.js.map +1 -1
- package/esm/src/di/injector.d.ts +4 -1
- package/esm/src/di/injector.js +5 -2
- package/esm/src/di/injector.js.map +1 -1
- package/esm/src/di/injector.metadata.json +1 -1
- package/esm/src/di/metadata.d.ts +8 -1
- package/esm/src/di/metadata.js +10 -3
- package/esm/src/di/metadata.js.map +1 -1
- package/esm/src/di/opaque_token.d.ts +2 -1
- package/esm/src/di/opaque_token.js +22 -21
- package/esm/src/di/opaque_token.js.map +1 -1
- package/esm/src/di/provider.d.ts +11 -10
- package/esm/src/di/provider.js +17 -14
- package/esm/src/di/provider.js.map +1 -1
- package/esm/src/di/provider.metadata.json +1 -0
- package/esm/src/di/provider_util.js.map +1 -1
- package/esm/src/di/provider_util.metadata.json +1 -0
- package/esm/src/di/reflective_exceptions.d.ts +11 -16
- package/esm/src/di/reflective_exceptions.js +28 -22
- package/esm/src/di/reflective_exceptions.js.map +1 -1
- package/esm/src/di/reflective_injector.d.ts +3 -33
- package/esm/src/di/reflective_injector.js +10 -7
- package/esm/src/di/reflective_injector.js.map +1 -1
- package/esm/src/di/reflective_key.d.ts +1 -8
- package/esm/src/di/reflective_key.js +3 -2
- package/esm/src/di/reflective_key.js.map +1 -1
- package/esm/src/di/reflective_provider.d.ts +2 -1
- package/esm/src/di/reflective_provider.js +6 -5
- package/esm/src/di/reflective_provider.js.map +1 -1
- package/esm/src/di/reflective_provider.metadata.json +1 -0
- package/esm/src/di.d.ts +2 -2
- package/esm/src/di.js +6 -6
- package/esm/src/di.js.map +1 -1
- package/esm/src/facade/async.d.ts +11 -4
- package/esm/src/facade/async.js +25 -15
- package/esm/src/facade/async.js.map +1 -1
- package/esm/src/facade/base_wrapped_exception.js +4 -4
- package/esm/src/facade/base_wrapped_exception.js.map +1 -1
- package/esm/src/facade/collection.js +1 -1
- package/esm/src/facade/collection.js.map +1 -1
- package/esm/src/facade/collection.metadata.json +1 -1
- package/esm/src/facade/exception_handler.d.ts +2 -11
- package/esm/src/facade/exception_handler.js +8 -7
- package/esm/src/facade/exception_handler.js.map +1 -1
- package/esm/src/facade/exceptions.d.ts +4 -0
- package/esm/src/facade/exceptions.js +6 -2
- package/esm/src/facade/exceptions.js.map +1 -1
- package/esm/src/facade/exceptions.metadata.json +1 -0
- package/esm/src/facade/lang.d.ts +6 -4
- package/esm/src/facade/lang.js +12 -11
- package/esm/src/facade/lang.js.map +1 -1
- package/esm/src/facade/lang.metadata.json +1 -1
- package/esm/src/facade/math.d.ts +2 -0
- package/esm/src/facade/math.js +4 -0
- package/esm/src/facade/math.js.map +1 -0
- package/esm/src/facade/math.metadata.json +1 -0
- package/esm/src/facade/promise.js.map +1 -1
- package/esm/src/linker/component_factory.d.ts +5 -4
- package/esm/src/linker/component_factory.js +7 -3
- package/esm/src/linker/component_factory.js.map +1 -1
- package/esm/src/linker/component_resolver.d.ts +5 -4
- package/esm/src/linker/component_resolver.js +12 -7
- package/esm/src/linker/component_resolver.js.map +1 -1
- package/esm/src/linker/component_resolver.metadata.json +1 -1
- package/esm/src/linker/debug_context.js +5 -4
- package/esm/src/linker/debug_context.js.map +1 -1
- package/esm/src/linker/dynamic_component_loader.d.ts +5 -6
- package/esm/src/linker/dynamic_component_loader.js +5 -3
- package/esm/src/linker/dynamic_component_loader.js.map +1 -1
- package/esm/src/linker/dynamic_component_loader.metadata.json +1 -1
- package/esm/src/linker/element.d.ts +3 -3
- package/esm/src/linker/element.js +5 -5
- package/esm/src/linker/element.js.map +1 -1
- package/esm/src/linker/element_injector.js.map +1 -1
- package/esm/src/linker/element_ref.d.ts +1 -0
- package/esm/src/linker/element_ref.js +5 -5
- package/esm/src/linker/element_ref.js.map +1 -1
- package/esm/src/linker/exceptions.d.ts +4 -1
- package/esm/src/linker/exceptions.js +4 -1
- package/esm/src/linker/exceptions.js.map +1 -1
- package/esm/src/linker/query_list.d.ts +3 -10
- package/esm/src/linker/query_list.js +8 -7
- package/esm/src/linker/query_list.js.map +1 -1
- package/esm/src/linker/systemjs_component_resolver.d.ts +21 -0
- package/esm/src/linker/systemjs_component_resolver.js +44 -0
- package/esm/src/linker/systemjs_component_resolver.js.map +1 -0
- package/esm/src/linker/template_ref.d.ts +2 -1
- package/esm/src/linker/template_ref.js +1 -0
- package/esm/src/linker/template_ref.js.map +1 -1
- package/esm/src/linker/view.d.ts +12 -1
- package/esm/src/linker/view.js +62 -16
- package/esm/src/linker/view.js.map +1 -1
- package/esm/src/linker/view_container_ref.d.ts +2 -10
- package/esm/src/linker/view_container_ref.js +4 -3
- package/esm/src/linker/view_container_ref.js.map +1 -1
- package/esm/src/linker/view_ref.d.ts +5 -1
- package/esm/src/linker/view_ref.js +6 -2
- package/esm/src/linker/view_ref.js.map +1 -1
- package/esm/src/linker/view_type.js.map +1 -1
- package/esm/src/linker/view_utils.d.ts +2 -4
- package/esm/src/linker/view_utils.js +21 -21
- package/esm/src/linker/view_utils.js.map +1 -1
- package/esm/src/linker/view_utils.metadata.json +1 -1
- package/esm/src/linker.d.ts +5 -4
- package/esm/src/linker.js +5 -4
- package/esm/src/linker.js.map +1 -1
- package/esm/src/metadata/di.d.ts +8 -1
- package/esm/src/metadata/di.js +10 -3
- package/esm/src/metadata/di.js.map +1 -1
- package/esm/src/metadata/directives.d.ts +104 -20
- package/esm/src/metadata/directives.js +25 -19
- package/esm/src/metadata/directives.js.map +1 -1
- package/esm/src/metadata/lifecycle_hooks.d.ts +46 -31
- package/esm/src/metadata/lifecycle_hooks.js +464 -10
- package/esm/src/metadata/lifecycle_hooks.js.map +1 -1
- package/esm/src/metadata/lifecycle_hooks.metadata.json +1 -1
- package/esm/src/metadata/view.d.ts +6 -2
- package/esm/src/metadata/view.js +3 -1
- package/esm/src/metadata/view.js.map +1 -1
- package/esm/src/metadata/view.metadata.json +1 -1
- package/esm/src/metadata.d.ts +49 -15
- package/esm/src/metadata.js +35 -10
- package/esm/src/metadata.js.map +1 -1
- package/esm/src/metadata.metadata.json +1 -1
- package/esm/src/platform_common_providers.d.ts +1 -0
- package/esm/src/platform_common_providers.js +3 -3
- package/esm/src/platform_common_providers.js.map +1 -1
- package/esm/src/platform_common_providers.metadata.json +1 -1
- package/esm/src/platform_directives_and_pipes.d.ts +48 -45
- package/esm/src/platform_directives_and_pipes.js +50 -47
- package/esm/src/platform_directives_and_pipes.js.map +1 -1
- package/esm/src/platform_directives_and_pipes.metadata.json +1 -1
- package/esm/src/profile/profile.d.ts +5 -1
- package/esm/src/profile/profile.js +4 -0
- package/esm/src/profile/profile.js.map +1 -1
- package/esm/src/profile/profile.metadata.json +1 -1
- package/esm/src/profile/wtf_impl.js +1 -1
- package/esm/src/profile/wtf_impl.js.map +1 -1
- package/esm/src/profile/wtf_impl.metadata.json +1 -0
- package/esm/src/profile/wtf_init.js +2 -2
- package/esm/src/profile/wtf_init.js.map +1 -1
- package/esm/src/reflection/platform_reflection_capabilities.d.ts +4 -3
- package/esm/src/reflection/platform_reflection_capabilities.js.map +1 -1
- package/esm/src/reflection/reflection.d.ts +1 -1
- package/esm/src/reflection/reflection.js +2 -2
- package/esm/src/reflection/reflection.js.map +1 -1
- package/esm/src/reflection/reflection.metadata.json +1 -1
- package/esm/src/reflection/reflection_capabilities.d.ts +4 -5
- package/esm/src/reflection/reflection_capabilities.js +22 -10
- package/esm/src/reflection/reflection_capabilities.js.map +1 -1
- package/esm/src/reflection/reflector.d.ts +8 -20
- package/esm/src/reflection/reflector.js +13 -3
- package/esm/src/reflection/reflector.js.map +1 -1
- package/esm/src/reflection/reflector_reader.js +3 -3
- package/esm/src/reflection/reflector_reader.js.map +1 -1
- package/esm/src/reflection/types.js.map +1 -1
- package/esm/src/render/api.d.ts +17 -6
- package/esm/src/render/api.js +8 -1
- package/esm/src/render/api.js.map +1 -1
- package/esm/src/render.d.ts +1 -1
- package/esm/src/render.js +1 -1
- package/esm/src/render.js.map +1 -1
- package/esm/src/security.js +6 -6
- package/esm/src/security.js.map +1 -1
- package/esm/src/testability/testability.d.ts +3 -19
- package/esm/src/testability/testability.js +10 -5
- package/esm/src/testability/testability.js.map +1 -1
- package/esm/src/testability/testability.metadata.json +1 -1
- package/esm/src/util/decorators.d.ts +2 -1
- package/esm/src/util/decorators.js +10 -9
- package/esm/src/util/decorators.js.map +1 -1
- package/esm/src/util.js.map +1 -1
- package/esm/src/zone/ng_zone.d.ts +6 -17
- package/esm/src/zone/ng_zone.js +7 -6
- package/esm/src/zone/ng_zone.js.map +1 -1
- package/esm/src/zone/ng_zone_impl.d.ts +1 -4
- package/esm/src/zone/ng_zone_impl.js +3 -2
- package/esm/src/zone/ng_zone_impl.js.map +1 -1
- package/esm/src/zone.js.map +1 -1
- package/esm/testing/async.js +20 -22
- package/esm/testing/async.js.map +1 -1
- package/esm/testing/async.metadata.json +1 -0
- package/esm/testing/async_test_completer.js.map +1 -1
- package/esm/testing/fake_async.d.ts +4 -1
- package/esm/testing/fake_async.js +9 -2
- package/esm/testing/fake_async.js.map +1 -1
- package/esm/testing/lang_utils.js +1 -1
- package/esm/testing/lang_utils.js.map +1 -1
- package/esm/testing/lang_utils.metadata.json +1 -0
- package/esm/testing/logger.js +5 -3
- package/esm/testing/logger.js.map +1 -1
- package/esm/testing/logger.metadata.json +1 -1
- package/esm/testing/mock_application_ref.d.ts +1 -1
- package/esm/testing/mock_application_ref.js +1 -0
- package/esm/testing/mock_application_ref.js.map +1 -1
- package/esm/testing/mock_application_ref.metadata.json +1 -1
- package/esm/testing/ng_zone_mock.d.ts +0 -1
- package/esm/testing/ng_zone_mock.js +2 -1
- package/esm/testing/ng_zone_mock.js.map +1 -1
- package/esm/testing/ng_zone_mock.metadata.json +1 -1
- package/esm/testing/regexp.js +1 -1
- package/esm/testing/regexp.js.map +1 -1
- package/esm/testing/regexp.metadata.json +1 -0
- package/esm/testing/test_injector.d.ts +6 -12
- package/esm/testing/test_injector.js +4 -10
- package/esm/testing/test_injector.js.map +1 -1
- package/esm/testing/test_injector.metadata.json +1 -0
- package/esm/testing/testing.d.ts +2 -2
- package/esm/testing/testing.js +2 -2
- package/esm/testing/testing.js.map +1 -1
- package/esm/testing/testing.metadata.json +1 -1
- package/esm/testing.js.map +1 -1
- package/index.d.ts +5 -4
- package/index.js +10 -8
- package/index.js.map +1 -1
- package/package.json +5 -1
- package/private_export.d.ts +96 -11
- package/private_export.js +39 -10
- package/private_export.js.map +1 -1
- package/private_export.metadata.json +1 -1
- package/src/animation/active_animation_players_map.d.ts +11 -0
- package/src/animation/active_animation_players_map.js +54 -0
- package/src/animation/active_animation_players_map.js.map +1 -0
- package/src/animation/animation_constants.d.ts +4 -0
- package/src/animation/animation_constants.js +6 -0
- package/src/animation/animation_constants.js.map +1 -0
- package/src/animation/animation_constants.metadata.json +1 -0
- package/src/animation/animation_driver.d.ts +9 -0
- package/src/animation/animation_driver.js +25 -0
- package/src/animation/animation_driver.js.map +1 -0
- package/src/animation/animation_group_player.d.ts +18 -0
- package/src/animation/animation_group_player.js +64 -0
- package/src/animation/animation_group_player.js.map +1 -0
- package/src/animation/animation_keyframe.d.ts +6 -0
- package/src/animation/animation_keyframe.js +10 -0
- package/src/animation/animation_keyframe.js.map +1 -0
- package/src/animation/animation_player.d.ts +26 -0
- package/src/animation/animation_player.js +42 -0
- package/src/animation/animation_player.js.map +1 -0
- package/src/animation/animation_sequence_player.d.ts +21 -0
- package/src/animation/animation_sequence_player.js +69 -0
- package/src/animation/animation_sequence_player.js.map +1 -0
- package/src/animation/animation_style_util.d.ts +32 -0
- package/src/animation/animation_style_util.js +99 -0
- package/src/animation/animation_style_util.js.map +1 -0
- package/src/animation/animation_style_util.metadata.json +1 -0
- package/src/animation/animation_styles.d.ts +8 -0
- package/src/animation/animation_styles.js +9 -0
- package/src/animation/animation_styles.js.map +1 -0
- package/src/animation/metadata.d.ts +511 -0
- package/src/animation/metadata.js +627 -0
- package/src/animation/metadata.js.map +1 -0
- package/src/animation/metadata.metadata.json +1 -0
- package/src/application_common_providers.d.ts +1 -0
- package/src/application_common_providers.js +4 -3
- package/src/application_common_providers.js.map +1 -1
- package/src/application_common_providers.metadata.json +1 -1
- package/src/application_ref.d.ts +17 -41
- package/src/application_ref.js +30 -21
- package/src/application_ref.js.map +1 -1
- package/src/application_ref.metadata.json +1 -1
- package/src/application_tokens.d.ts +6 -1
- package/src/application_tokens.js +9 -4
- package/src/application_tokens.js.map +1 -1
- package/src/application_tokens.metadata.json +1 -1
- package/src/change_detection/change_detection.d.ts +9 -8
- package/src/change_detection/change_detection.js +21 -21
- package/src/change_detection/change_detection.js.map +1 -1
- package/src/change_detection/change_detection.metadata.json +1 -1
- package/src/change_detection/change_detection_util.d.ts +3 -1
- package/src/change_detection/change_detection_util.js +6 -5
- package/src/change_detection/change_detection_util.js.map +1 -1
- package/src/change_detection/change_detection_util.metadata.json +1 -1
- package/src/change_detection/change_detector_ref.d.ts +3 -0
- package/src/change_detection/change_detector_ref.js +3 -0
- package/src/change_detection/change_detector_ref.js.map +1 -1
- package/src/change_detection/constants.d.ts +1 -0
- package/src/change_detection/constants.js +4 -3
- package/src/change_detection/constants.js.map +1 -1
- package/src/change_detection/constants.metadata.json +1 -1
- package/src/change_detection/differs/default_iterable_differ.d.ts +6 -94
- package/src/change_detection/differs/default_iterable_differ.js +25 -18
- package/src/change_detection/differs/default_iterable_differ.js.map +1 -1
- package/src/change_detection/differs/default_keyvalue_differ.d.ts +3 -30
- package/src/change_detection/differs/default_keyvalue_differ.js +13 -8
- package/src/change_detection/differs/default_keyvalue_differ.js.map +1 -1
- package/src/change_detection/differs/iterable_differs.d.ts +4 -1
- package/src/change_detection/differs/iterable_differs.js +4 -3
- package/src/change_detection/differs/iterable_differs.js.map +1 -1
- package/src/change_detection/differs/keyvalue_differs.d.ts +2 -1
- package/src/change_detection/differs/keyvalue_differs.js +4 -3
- package/src/change_detection/differs/keyvalue_differs.js.map +1 -1
- package/src/change_detection/pipe_transform.js.map +1 -1
- package/src/change_detection.d.ts +1 -1
- package/src/change_detection.js +9 -9
- package/src/change_detection.js.map +1 -1
- package/src/console.js +2 -1
- package/src/console.js.map +1 -1
- package/src/console.metadata.json +1 -1
- package/src/debug/debug_node.d.ts +20 -2
- package/src/debug/debug_node.js +16 -2
- package/src/debug/debug_node.js.map +1 -1
- package/src/debug/debug_node.metadata.json +1 -0
- package/src/debug/debug_renderer.d.ts +10 -6
- package/src/debug/debug_renderer.js +12 -1
- package/src/debug/debug_renderer.js.map +1 -1
- package/src/di/decorators.d.ts +13 -1
- package/src/di/decorators.js +7 -1
- package/src/di/decorators.js.map +1 -1
- package/src/di/decorators.metadata.json +1 -1
- package/src/di/forward_ref.d.ts +3 -1
- package/src/di/forward_ref.js +3 -1
- package/src/di/forward_ref.js.map +1 -1
- package/src/di/injector.d.ts +4 -1
- package/src/di/injector.js +5 -2
- package/src/di/injector.js.map +1 -1
- package/src/di/injector.metadata.json +1 -1
- package/src/di/metadata.d.ts +8 -1
- package/src/di/metadata.js +10 -3
- package/src/di/metadata.js.map +1 -1
- package/src/di/opaque_token.d.ts +2 -1
- package/src/di/opaque_token.js +22 -21
- package/src/di/opaque_token.js.map +1 -1
- package/src/di/provider.d.ts +11 -10
- package/src/di/provider.js +17 -14
- package/src/di/provider.js.map +1 -1
- package/src/di/provider.metadata.json +1 -0
- package/src/di/provider_util.js.map +1 -1
- package/src/di/provider_util.metadata.json +1 -0
- package/src/di/reflective_exceptions.d.ts +11 -16
- package/src/di/reflective_exceptions.js +28 -22
- package/src/di/reflective_exceptions.js.map +1 -1
- package/src/di/reflective_injector.d.ts +3 -33
- package/src/di/reflective_injector.js +9 -6
- package/src/di/reflective_injector.js.map +1 -1
- package/src/di/reflective_key.d.ts +1 -8
- package/src/di/reflective_key.js +3 -2
- package/src/di/reflective_key.js.map +1 -1
- package/src/di/reflective_provider.d.ts +2 -1
- package/src/di/reflective_provider.js +6 -5
- package/src/di/reflective_provider.js.map +1 -1
- package/src/di/reflective_provider.metadata.json +1 -0
- package/src/di.d.ts +2 -2
- package/src/di.js +7 -9
- package/src/di.js.map +1 -1
- package/src/facade/async.d.ts +11 -4
- package/src/facade/async.js +27 -17
- package/src/facade/async.js.map +1 -1
- package/src/facade/base_wrapped_exception.js +4 -4
- package/src/facade/base_wrapped_exception.js.map +1 -1
- package/src/facade/collection.js.map +1 -1
- package/src/facade/collection.metadata.json +1 -1
- package/src/facade/exception_handler.d.ts +2 -11
- package/src/facade/exception_handler.js +8 -7
- package/src/facade/exception_handler.js.map +1 -1
- package/src/facade/exceptions.d.ts +4 -0
- package/src/facade/exceptions.js +6 -2
- package/src/facade/exceptions.js.map +1 -1
- package/src/facade/exceptions.metadata.json +1 -0
- package/src/facade/lang.d.ts +6 -4
- package/src/facade/lang.js +12 -11
- package/src/facade/lang.js.map +1 -1
- package/src/facade/lang.metadata.json +1 -1
- package/src/facade/math.d.ts +2 -0
- package/src/facade/math.js +5 -0
- package/src/facade/math.js.map +1 -0
- package/src/facade/math.metadata.json +1 -0
- package/src/facade/promise.js.map +1 -1
- package/src/linker/component_factory.d.ts +5 -4
- package/src/linker/component_factory.js +7 -3
- package/src/linker/component_factory.js.map +1 -1
- package/src/linker/component_resolver.d.ts +5 -4
- package/src/linker/component_resolver.js +12 -7
- package/src/linker/component_resolver.js.map +1 -1
- package/src/linker/component_resolver.metadata.json +1 -1
- package/src/linker/debug_context.js +5 -4
- package/src/linker/debug_context.js.map +1 -1
- package/src/linker/dynamic_component_loader.d.ts +5 -6
- package/src/linker/dynamic_component_loader.js +5 -3
- package/src/linker/dynamic_component_loader.js.map +1 -1
- package/src/linker/dynamic_component_loader.metadata.json +1 -1
- package/src/linker/element.d.ts +3 -3
- package/src/linker/element.js +5 -5
- package/src/linker/element.js.map +1 -1
- package/src/linker/element_injector.js.map +1 -1
- package/src/linker/element_ref.d.ts +1 -0
- package/src/linker/element_ref.js +5 -5
- package/src/linker/element_ref.js.map +1 -1
- package/src/linker/exceptions.d.ts +4 -1
- package/src/linker/exceptions.js +4 -1
- package/src/linker/exceptions.js.map +1 -1
- package/src/linker/query_list.d.ts +3 -10
- package/src/linker/query_list.js +8 -7
- package/src/linker/query_list.js.map +1 -1
- package/src/linker/systemjs_component_resolver.d.ts +21 -0
- package/src/linker/systemjs_component_resolver.js +52 -0
- package/src/linker/systemjs_component_resolver.js.map +1 -0
- package/src/linker/template_ref.d.ts +2 -1
- package/src/linker/template_ref.js +1 -0
- package/src/linker/template_ref.js.map +1 -1
- package/src/linker/view.d.ts +12 -1
- package/src/linker/view.js +65 -15
- package/src/linker/view.js.map +1 -1
- package/src/linker/view_container_ref.d.ts +2 -10
- package/src/linker/view_container_ref.js +4 -3
- package/src/linker/view_container_ref.js.map +1 -1
- package/src/linker/view_ref.d.ts +5 -1
- package/src/linker/view_ref.js +6 -2
- package/src/linker/view_ref.js.map +1 -1
- package/src/linker/view_type.js.map +1 -1
- package/src/linker/view_utils.d.ts +2 -4
- package/src/linker/view_utils.js +21 -21
- package/src/linker/view_utils.js.map +1 -1
- package/src/linker/view_utils.metadata.json +1 -1
- package/src/linker.d.ts +5 -4
- package/src/linker.js +12 -9
- package/src/linker.js.map +1 -1
- package/src/metadata/di.d.ts +8 -1
- package/src/metadata/di.js +10 -3
- package/src/metadata/di.js.map +1 -1
- package/src/metadata/directives.d.ts +104 -20
- package/src/metadata/directives.js +25 -27
- package/src/metadata/directives.js.map +1 -1
- package/src/metadata/lifecycle_hooks.d.ts +46 -31
- package/src/metadata/lifecycle_hooks.js +496 -10
- package/src/metadata/lifecycle_hooks.js.map +1 -1
- package/src/metadata/lifecycle_hooks.metadata.json +1 -1
- package/src/metadata/view.d.ts +6 -2
- package/src/metadata/view.js +3 -1
- package/src/metadata/view.js.map +1 -1
- package/src/metadata/view.metadata.json +1 -1
- package/src/metadata.d.ts +49 -15
- package/src/metadata.js +70 -37
- package/src/metadata.js.map +1 -1
- package/src/metadata.metadata.json +1 -1
- package/src/platform_common_providers.d.ts +1 -0
- package/src/platform_common_providers.js +3 -3
- package/src/platform_common_providers.js.map +1 -1
- package/src/platform_common_providers.metadata.json +1 -1
- package/src/platform_directives_and_pipes.d.ts +48 -45
- package/src/platform_directives_and_pipes.js +50 -47
- package/src/platform_directives_and_pipes.js.map +1 -1
- package/src/platform_directives_and_pipes.metadata.json +1 -1
- package/src/profile/profile.d.ts +5 -1
- package/src/profile/profile.js +5 -3
- package/src/profile/profile.js.map +1 -1
- package/src/profile/profile.metadata.json +1 -1
- package/src/profile/wtf_impl.js +1 -1
- package/src/profile/wtf_impl.js.map +1 -1
- package/src/profile/wtf_impl.metadata.json +1 -0
- package/src/profile/wtf_init.js +2 -2
- package/src/profile/wtf_init.js.map +1 -1
- package/src/reflection/platform_reflection_capabilities.d.ts +4 -3
- package/src/reflection/platform_reflection_capabilities.js.map +1 -1
- package/src/reflection/reflection.d.ts +1 -1
- package/src/reflection/reflection.js +2 -2
- package/src/reflection/reflection.js.map +1 -1
- package/src/reflection/reflection.metadata.json +1 -1
- package/src/reflection/reflection_capabilities.d.ts +4 -5
- package/src/reflection/reflection_capabilities.js +24 -10
- package/src/reflection/reflection_capabilities.js.map +1 -1
- package/src/reflection/reflector.d.ts +8 -20
- package/src/reflection/reflector.js +13 -3
- package/src/reflection/reflector.js.map +1 -1
- package/src/reflection/reflector_reader.js +3 -3
- package/src/reflection/reflector_reader.js.map +1 -1
- package/src/reflection/types.js.map +1 -1
- package/src/render/api.d.ts +17 -6
- package/src/render/api.js +8 -1
- package/src/render/api.js.map +1 -1
- package/src/render.d.ts +1 -1
- package/src/render.js +2 -2
- package/src/render.js.map +1 -1
- package/src/security.js +6 -6
- package/src/security.js.map +1 -1
- package/src/testability/testability.d.ts +3 -19
- package/src/testability/testability.js +10 -5
- package/src/testability/testability.js.map +1 -1
- package/src/testability/testability.metadata.json +1 -1
- package/src/util/decorators.d.ts +2 -1
- package/src/util/decorators.js +10 -9
- package/src/util/decorators.js.map +1 -1
- package/src/util.js.map +1 -1
- package/src/zone/ng_zone.d.ts +6 -17
- package/src/zone/ng_zone.js +11 -6
- package/src/zone/ng_zone.js.map +1 -1
- package/src/zone/ng_zone_impl.d.ts +1 -4
- package/src/zone/ng_zone_impl.js +3 -2
- package/src/zone/ng_zone_impl.js.map +1 -1
- package/src/zone.js.map +1 -1
- package/testing/async.js +20 -22
- package/testing/async.js.map +1 -1
- package/testing/async.metadata.json +1 -0
- package/testing/async_test_completer.js.map +1 -1
- package/testing/fake_async.d.ts +4 -1
- package/testing/fake_async.js +10 -2
- package/testing/fake_async.js.map +1 -1
- package/testing/lang_utils.js +1 -1
- package/testing/lang_utils.js.map +1 -1
- package/testing/lang_utils.metadata.json +1 -0
- package/testing/logger.js +5 -3
- package/testing/logger.js.map +1 -1
- package/testing/logger.metadata.json +1 -1
- package/testing/mock_application_ref.d.ts +1 -1
- package/testing/mock_application_ref.js +1 -0
- package/testing/mock_application_ref.js.map +1 -1
- package/testing/mock_application_ref.metadata.json +1 -1
- package/testing/ng_zone_mock.d.ts +0 -1
- package/testing/ng_zone_mock.js +2 -1
- package/testing/ng_zone_mock.js.map +1 -1
- package/testing/ng_zone_mock.metadata.json +1 -1
- package/testing/regexp.js +1 -1
- package/testing/regexp.js.map +1 -1
- package/testing/regexp.metadata.json +1 -0
- package/testing/test_injector.d.ts +6 -12
- package/testing/test_injector.js +3 -9
- package/testing/test_injector.js.map +1 -1
- package/testing/test_injector.metadata.json +1 -0
- package/testing/testing.d.ts +2 -2
- package/testing/testing.js +5 -5
- package/testing/testing.js.map +1 -1
- package/testing/testing.metadata.json +1 -1
- package/testing.js.map +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnimationEntryMetadata } from '../animation/metadata';
|
|
2
|
+
import { ChangeDetectionStrategy } from '../change_detection/constants';
|
|
2
3
|
import { InjectableMetadata } from '../di/metadata';
|
|
4
|
+
import { Type } from '../facade/lang';
|
|
3
5
|
import { ViewEncapsulation } from './view';
|
|
4
|
-
import { ChangeDetectionStrategy } from '../change_detection/constants';
|
|
5
6
|
/**
|
|
6
7
|
* Directives allow you to attach behavior to elements in the DOM.
|
|
7
8
|
*
|
|
@@ -380,6 +381,7 @@ import { ChangeDetectionStrategy } from '../change_detection/constants';
|
|
|
380
381
|
* the instantiated
|
|
381
382
|
* view occurs on the second `<li></li>` which is a sibling to the `<template>` element.
|
|
382
383
|
* @ts2dart_const
|
|
384
|
+
* @stable
|
|
383
385
|
*/
|
|
384
386
|
export declare class DirectiveMetadata extends InjectableMetadata {
|
|
385
387
|
/**
|
|
@@ -463,6 +465,11 @@ export declare class DirectiveMetadata extends InjectableMetadata {
|
|
|
463
465
|
*
|
|
464
466
|
*/
|
|
465
467
|
inputs: string[];
|
|
468
|
+
/**
|
|
469
|
+
* Use `inputs` instead
|
|
470
|
+
*
|
|
471
|
+
* @deprecated
|
|
472
|
+
*/
|
|
466
473
|
properties: string[];
|
|
467
474
|
private _inputs;
|
|
468
475
|
private _properties;
|
|
@@ -512,6 +519,11 @@ export declare class DirectiveMetadata extends InjectableMetadata {
|
|
|
512
519
|
*
|
|
513
520
|
*/
|
|
514
521
|
outputs: string[];
|
|
522
|
+
/**
|
|
523
|
+
* Use `outputs` instead
|
|
524
|
+
*
|
|
525
|
+
* @deprecated
|
|
526
|
+
*/
|
|
515
527
|
events: string[];
|
|
516
528
|
private _outputs;
|
|
517
529
|
private _events;
|
|
@@ -641,7 +653,7 @@ export declare class DirectiveMetadata extends InjectableMetadata {
|
|
|
641
653
|
*
|
|
642
654
|
* @Directive({
|
|
643
655
|
* selector: 'greet',
|
|
644
|
-
*
|
|
656
|
+
* providers: [
|
|
645
657
|
* Greeter
|
|
646
658
|
* ]
|
|
647
659
|
* })
|
|
@@ -655,10 +667,7 @@ export declare class DirectiveMetadata extends InjectableMetadata {
|
|
|
655
667
|
* ```
|
|
656
668
|
*/
|
|
657
669
|
providers: any[];
|
|
658
|
-
/** @deprecated */
|
|
659
|
-
bindings: any[];
|
|
660
670
|
private _providers;
|
|
661
|
-
private _bindings;
|
|
662
671
|
/**
|
|
663
672
|
* Defines the name that can be used in the template to assign this directive to a variable.
|
|
664
673
|
*
|
|
@@ -718,17 +727,16 @@ export declare class DirectiveMetadata extends InjectableMetadata {
|
|
|
718
727
|
queries: {
|
|
719
728
|
[key: string]: any;
|
|
720
729
|
};
|
|
721
|
-
constructor({selector, inputs, outputs, properties, events, host,
|
|
730
|
+
constructor({selector, inputs, outputs, properties, events, host, providers, exportAs, queries}?: {
|
|
722
731
|
selector?: string;
|
|
723
732
|
inputs?: string[];
|
|
724
733
|
outputs?: string[];
|
|
725
|
-
properties?: string[];
|
|
726
|
-
events?: string[];
|
|
734
|
+
/** @deprecated */ properties?: string[];
|
|
735
|
+
/** @deprecated */ events?: string[];
|
|
727
736
|
host?: {
|
|
728
737
|
[key: string]: string;
|
|
729
738
|
};
|
|
730
739
|
providers?: any[];
|
|
731
|
-
/** @deprecated */ bindings?: any[];
|
|
732
740
|
exportAs?: string;
|
|
733
741
|
queries?: {
|
|
734
742
|
[key: string]: any;
|
|
@@ -761,6 +769,7 @@ export declare class DirectiveMetadata extends InjectableMetadata {
|
|
|
761
769
|
*
|
|
762
770
|
* {@example core/ts/metadata/metadata.ts region='component'}
|
|
763
771
|
* @ts2dart_const
|
|
772
|
+
* @stable
|
|
764
773
|
*/
|
|
765
774
|
export declare class ComponentMetadata extends DirectiveMetadata {
|
|
766
775
|
/**
|
|
@@ -812,14 +821,15 @@ export declare class ComponentMetadata extends DirectiveMetadata {
|
|
|
812
821
|
* ```
|
|
813
822
|
*/
|
|
814
823
|
viewProviders: any[];
|
|
815
|
-
viewBindings: any[];
|
|
816
824
|
private _viewProviders;
|
|
817
|
-
private _viewBindings;
|
|
818
825
|
/**
|
|
819
826
|
* The module id of the module that contains the component.
|
|
820
827
|
* Needed to be able to resolve relative urls for templates and styles.
|
|
828
|
+
* In CommonJS, this can always be set to `module.id`, similarly SystemJS exposes `__moduleName`
|
|
829
|
+
* variable within each module.
|
|
830
|
+
*
|
|
821
831
|
* In Dart, this can be determined automatically and does not need to be set.
|
|
822
|
-
|
|
832
|
+
|
|
823
833
|
*
|
|
824
834
|
* ## Simple Example
|
|
825
835
|
*
|
|
@@ -838,23 +848,93 @@ export declare class ComponentMetadata extends DirectiveMetadata {
|
|
|
838
848
|
template: string;
|
|
839
849
|
styleUrls: string[];
|
|
840
850
|
styles: string[];
|
|
851
|
+
/**
|
|
852
|
+
* Animations are defined on components via an animation-like DSL. This DSL approach to describing
|
|
853
|
+
* animations allows for a flexibility that both benefits developers and the framework.
|
|
854
|
+
*
|
|
855
|
+
* Animations work by listening on state changes that occur on an element within
|
|
856
|
+
* the template. When a state change occurs, Angular can then take advantage and animate the
|
|
857
|
+
* arc in between. This works similar to how CSS transitions work, however, by having a
|
|
858
|
+
* programmatic DSL, animations are not limited to environments that are DOM-specific.
|
|
859
|
+
* (Angular can also perform optimizations behind the scenes to make animations more performant.)
|
|
860
|
+
*
|
|
861
|
+
* For animations to be available for use, animation state changes are placed within
|
|
862
|
+
* {@link trigger animation triggers} which are housed inside of the `animations` annotation
|
|
863
|
+
* metadata. Within a trigger both {@link state state} and {@link transition transition} entries
|
|
864
|
+
* can be placed.
|
|
865
|
+
*
|
|
866
|
+
* ```typescript
|
|
867
|
+
* @Component({
|
|
868
|
+
* selector: 'animation-cmp',
|
|
869
|
+
* templateUrl: 'animation-cmp.html',
|
|
870
|
+
* animations: [
|
|
871
|
+
* // this here is our animation trigger that
|
|
872
|
+
* // will contain our state change animations.
|
|
873
|
+
* trigger('myTriggerName', [
|
|
874
|
+
* // the styles defined for the `on` and `off`
|
|
875
|
+
* // states declared below are persisted on the
|
|
876
|
+
* // element once the animation completes.
|
|
877
|
+
* state('on', style({ opacity: 1 }),
|
|
878
|
+
* state('off', style({ opacity: 0 }),
|
|
879
|
+
*
|
|
880
|
+
* // this here is our animation that kicks off when
|
|
881
|
+
* // this state change jump is true
|
|
882
|
+
* transition('on => off', [
|
|
883
|
+
* animate("1s")
|
|
884
|
+
* ])
|
|
885
|
+
* ])
|
|
886
|
+
* ]
|
|
887
|
+
* })
|
|
888
|
+
* ```
|
|
889
|
+
*
|
|
890
|
+
* As depicted in the code above, a group of related animation states are all contained within
|
|
891
|
+
* an animation `trigger` (the code example above called the trigger `myTriggerName`).
|
|
892
|
+
* When a trigger is created then it can be bound onto an element within the component's
|
|
893
|
+
* template via a property prefixed by an `@` symbol followed by trigger name and an expression
|
|
894
|
+
* that
|
|
895
|
+
* is used to determine the state value for that trigger.
|
|
896
|
+
*
|
|
897
|
+
* ```html
|
|
898
|
+
* <!-- animation-cmp.html -->
|
|
899
|
+
* <div @myTriggerName="expression">...</div>
|
|
900
|
+
* ```
|
|
901
|
+
*
|
|
902
|
+
* For state changes to be executed, the `expression` value must change value from its existing
|
|
903
|
+
* value
|
|
904
|
+
* to something that we have set an animation to animate on (in the example above we are listening
|
|
905
|
+
* to a change of state between `on` and `off`). The `expression` value attached to the trigger
|
|
906
|
+
* must be something that can be evaluated with the template/component context.
|
|
907
|
+
*
|
|
908
|
+
* ### DSL Animation Functions
|
|
909
|
+
*
|
|
910
|
+
* Please visit each of the animation DSL functions listed below to gain a better understanding
|
|
911
|
+
* of how and why they are used for crafting animations in Angular2:
|
|
912
|
+
*
|
|
913
|
+
* - {@link trigger trigger()}
|
|
914
|
+
* - {@link state state()}
|
|
915
|
+
* - {@link transition transition()}
|
|
916
|
+
* - {@link group group()}
|
|
917
|
+
* - {@link sequence sequence()}
|
|
918
|
+
* - {@link style style()}
|
|
919
|
+
* - {@link animate animate()}
|
|
920
|
+
* - {@link keyframes keyframes()}
|
|
921
|
+
*/
|
|
922
|
+
animations: AnimationEntryMetadata[];
|
|
841
923
|
directives: Array<Type | any[]>;
|
|
842
924
|
pipes: Array<Type | any[]>;
|
|
843
925
|
encapsulation: ViewEncapsulation;
|
|
844
|
-
constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId,
|
|
926
|
+
constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId, providers, viewProviders, changeDetection, queries, templateUrl, template, styleUrls, styles, animations, directives, pipes, encapsulation}?: {
|
|
845
927
|
selector?: string;
|
|
846
928
|
inputs?: string[];
|
|
847
929
|
outputs?: string[];
|
|
848
|
-
properties?: string[];
|
|
849
|
-
events?: string[];
|
|
930
|
+
/** @deprecated */ properties?: string[];
|
|
931
|
+
/** @deprecated */ events?: string[];
|
|
850
932
|
host?: {
|
|
851
933
|
[key: string]: string;
|
|
852
934
|
};
|
|
853
|
-
/** @deprecated */ bindings?: any[];
|
|
854
935
|
providers?: any[];
|
|
855
936
|
exportAs?: string;
|
|
856
937
|
moduleId?: string;
|
|
857
|
-
/** @deprecated */ viewBindings?: any[];
|
|
858
938
|
viewProviders?: any[];
|
|
859
939
|
queries?: {
|
|
860
940
|
[key: string]: any;
|
|
@@ -864,6 +944,7 @@ export declare class ComponentMetadata extends DirectiveMetadata {
|
|
|
864
944
|
template?: string;
|
|
865
945
|
styleUrls?: string[];
|
|
866
946
|
styles?: string[];
|
|
947
|
+
animations?: AnimationEntryMetadata[];
|
|
867
948
|
directives?: Array<Type | any[]>;
|
|
868
949
|
pipes?: Array<Type | any[]>;
|
|
869
950
|
encapsulation?: ViewEncapsulation;
|
|
@@ -880,11 +961,10 @@ export declare class ComponentMetadata extends DirectiveMetadata {
|
|
|
880
961
|
*
|
|
881
962
|
* {@example core/ts/metadata/metadata.ts region='pipe'}
|
|
882
963
|
* @ts2dart_const
|
|
964
|
+
* @stable
|
|
883
965
|
*/
|
|
884
966
|
export declare class PipeMetadata extends InjectableMetadata {
|
|
885
967
|
name: string;
|
|
886
|
-
/** @internal */
|
|
887
|
-
_pure: boolean;
|
|
888
968
|
constructor({name, pure}: {
|
|
889
969
|
name: string;
|
|
890
970
|
pure?: boolean;
|
|
@@ -932,6 +1012,7 @@ export declare class PipeMetadata extends InjectableMetadata {
|
|
|
932
1012
|
* bootstrap(App);
|
|
933
1013
|
* ```
|
|
934
1014
|
* @ts2dart_const
|
|
1015
|
+
* @stable
|
|
935
1016
|
*/
|
|
936
1017
|
export declare class InputMetadata {
|
|
937
1018
|
/**
|
|
@@ -985,6 +1066,7 @@ export declare class InputMetadata {
|
|
|
985
1066
|
* bootstrap(App);
|
|
986
1067
|
* ```
|
|
987
1068
|
* @ts2dart_const
|
|
1069
|
+
* @stable
|
|
988
1070
|
*/
|
|
989
1071
|
export declare class OutputMetadata {
|
|
990
1072
|
bindingPropertyName: string;
|
|
@@ -1025,6 +1107,7 @@ export declare class OutputMetadata {
|
|
|
1025
1107
|
* bootstrap(App);
|
|
1026
1108
|
* ```
|
|
1027
1109
|
* @ts2dart_const
|
|
1110
|
+
* @stable
|
|
1028
1111
|
*/
|
|
1029
1112
|
export declare class HostBindingMetadata {
|
|
1030
1113
|
hostPropertyName: string;
|
|
@@ -1064,6 +1147,7 @@ export declare class HostBindingMetadata {
|
|
|
1064
1147
|
* bootstrap(App);
|
|
1065
1148
|
* ```
|
|
1066
1149
|
* @ts2dart_const
|
|
1150
|
+
* @stable
|
|
1067
1151
|
*/
|
|
1068
1152
|
export declare class HostListenerMetadata {
|
|
1069
1153
|
eventName: string;
|
|
@@ -4,9 +4,9 @@ var __extends = (this && this.__extends) || function (d, b) {
|
|
|
4
4
|
function __() { this.constructor = d; }
|
|
5
5
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
6
6
|
};
|
|
7
|
-
var lang_1 = require('../../src/facade/lang');
|
|
8
|
-
var metadata_1 = require('../di/metadata');
|
|
9
7
|
var constants_1 = require('../change_detection/constants');
|
|
8
|
+
var metadata_1 = require('../di/metadata');
|
|
9
|
+
var lang_1 = require('../facade/lang');
|
|
10
10
|
/**
|
|
11
11
|
* Directives allow you to attach behavior to elements in the DOM.
|
|
12
12
|
*
|
|
@@ -385,11 +385,12 @@ var constants_1 = require('../change_detection/constants');
|
|
|
385
385
|
* the instantiated
|
|
386
386
|
* view occurs on the second `<li></li>` which is a sibling to the `<template>` element.
|
|
387
387
|
* @ts2dart_const
|
|
388
|
+
* @stable
|
|
388
389
|
*/
|
|
389
390
|
var DirectiveMetadata = (function (_super) {
|
|
390
391
|
__extends(DirectiveMetadata, _super);
|
|
391
392
|
function DirectiveMetadata(_a) {
|
|
392
|
-
var _b = _a === void 0 ? {} : _a, selector = _b.selector, inputs = _b.inputs, outputs = _b.outputs, properties = _b.properties, events = _b.events, host = _b.host,
|
|
393
|
+
var _b = _a === void 0 ? {} : _a, selector = _b.selector, inputs = _b.inputs, outputs = _b.outputs, properties = _b.properties, events = _b.events, host = _b.host, providers = _b.providers, exportAs = _b.exportAs, queries = _b.queries;
|
|
393
394
|
_super.call(this);
|
|
394
395
|
this.selector = selector;
|
|
395
396
|
this._inputs = inputs;
|
|
@@ -400,7 +401,6 @@ var DirectiveMetadata = (function (_super) {
|
|
|
400
401
|
this.exportAs = exportAs;
|
|
401
402
|
this.queries = queries;
|
|
402
403
|
this._providers = providers;
|
|
403
|
-
this._bindings = bindings;
|
|
404
404
|
}
|
|
405
405
|
Object.defineProperty(DirectiveMetadata.prototype, "inputs", {
|
|
406
406
|
/**
|
|
@@ -458,6 +458,11 @@ var DirectiveMetadata = (function (_super) {
|
|
|
458
458
|
configurable: true
|
|
459
459
|
});
|
|
460
460
|
Object.defineProperty(DirectiveMetadata.prototype, "properties", {
|
|
461
|
+
/**
|
|
462
|
+
* Use `inputs` instead
|
|
463
|
+
*
|
|
464
|
+
* @deprecated
|
|
465
|
+
*/
|
|
461
466
|
get: function () { return this.inputs; },
|
|
462
467
|
enumerable: true,
|
|
463
468
|
configurable: true
|
|
@@ -515,6 +520,11 @@ var DirectiveMetadata = (function (_super) {
|
|
|
515
520
|
configurable: true
|
|
516
521
|
});
|
|
517
522
|
Object.defineProperty(DirectiveMetadata.prototype, "events", {
|
|
523
|
+
/**
|
|
524
|
+
* Use `outputs` instead
|
|
525
|
+
*
|
|
526
|
+
* @deprecated
|
|
527
|
+
*/
|
|
518
528
|
get: function () { return this.outputs; },
|
|
519
529
|
enumerable: true,
|
|
520
530
|
configurable: true
|
|
@@ -537,7 +547,7 @@ var DirectiveMetadata = (function (_super) {
|
|
|
537
547
|
*
|
|
538
548
|
* @Directive({
|
|
539
549
|
* selector: 'greet',
|
|
540
|
-
*
|
|
550
|
+
* providers: [
|
|
541
551
|
* Greeter
|
|
542
552
|
* ]
|
|
543
553
|
* })
|
|
@@ -550,16 +560,7 @@ var DirectiveMetadata = (function (_super) {
|
|
|
550
560
|
* }
|
|
551
561
|
* ```
|
|
552
562
|
*/
|
|
553
|
-
get: function () {
|
|
554
|
-
return lang_1.isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings :
|
|
555
|
-
this._providers;
|
|
556
|
-
},
|
|
557
|
-
enumerable: true,
|
|
558
|
-
configurable: true
|
|
559
|
-
});
|
|
560
|
-
Object.defineProperty(DirectiveMetadata.prototype, "bindings", {
|
|
561
|
-
/** @deprecated */
|
|
562
|
-
get: function () { return this.providers; },
|
|
563
|
+
get: function () { return this._providers; },
|
|
563
564
|
enumerable: true,
|
|
564
565
|
configurable: true
|
|
565
566
|
});
|
|
@@ -592,11 +593,12 @@ exports.DirectiveMetadata = DirectiveMetadata;
|
|
|
592
593
|
*
|
|
593
594
|
* {@example core/ts/metadata/metadata.ts region='component'}
|
|
594
595
|
* @ts2dart_const
|
|
596
|
+
* @stable
|
|
595
597
|
*/
|
|
596
598
|
var ComponentMetadata = (function (_super) {
|
|
597
599
|
__extends(ComponentMetadata, _super);
|
|
598
600
|
function ComponentMetadata(_a) {
|
|
599
|
-
var _b = _a === void 0 ? {} : _a, selector = _b.selector, inputs = _b.inputs, outputs = _b.outputs, properties = _b.properties, events = _b.events, host = _b.host, exportAs = _b.exportAs, moduleId = _b.moduleId,
|
|
601
|
+
var _b = _a === void 0 ? {} : _a, selector = _b.selector, inputs = _b.inputs, outputs = _b.outputs, properties = _b.properties, events = _b.events, host = _b.host, exportAs = _b.exportAs, moduleId = _b.moduleId, providers = _b.providers, viewProviders = _b.viewProviders, _c = _b.changeDetection, changeDetection = _c === void 0 ? constants_1.ChangeDetectionStrategy.Default : _c, queries = _b.queries, templateUrl = _b.templateUrl, template = _b.template, styleUrls = _b.styleUrls, styles = _b.styles, animations = _b.animations, directives = _b.directives, pipes = _b.pipes, encapsulation = _b.encapsulation;
|
|
600
602
|
_super.call(this, {
|
|
601
603
|
selector: selector,
|
|
602
604
|
inputs: inputs,
|
|
@@ -605,13 +607,11 @@ var ComponentMetadata = (function (_super) {
|
|
|
605
607
|
events: events,
|
|
606
608
|
host: host,
|
|
607
609
|
exportAs: exportAs,
|
|
608
|
-
bindings: bindings,
|
|
609
610
|
providers: providers,
|
|
610
611
|
queries: queries
|
|
611
612
|
});
|
|
612
613
|
this.changeDetection = changeDetection;
|
|
613
614
|
this._viewProviders = viewProviders;
|
|
614
|
-
this._viewBindings = viewBindings;
|
|
615
615
|
this.templateUrl = templateUrl;
|
|
616
616
|
this.template = template;
|
|
617
617
|
this.styleUrls = styleUrls;
|
|
@@ -620,6 +620,7 @@ var ComponentMetadata = (function (_super) {
|
|
|
620
620
|
this.pipes = pipes;
|
|
621
621
|
this.encapsulation = encapsulation;
|
|
622
622
|
this.moduleId = moduleId;
|
|
623
|
+
this.animations = animations;
|
|
623
624
|
}
|
|
624
625
|
Object.defineProperty(ComponentMetadata.prototype, "viewProviders", {
|
|
625
626
|
/**
|
|
@@ -660,15 +661,7 @@ var ComponentMetadata = (function (_super) {
|
|
|
660
661
|
*
|
|
661
662
|
* ```
|
|
662
663
|
*/
|
|
663
|
-
get: function () {
|
|
664
|
-
return lang_1.isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings :
|
|
665
|
-
this._viewProviders;
|
|
666
|
-
},
|
|
667
|
-
enumerable: true,
|
|
668
|
-
configurable: true
|
|
669
|
-
});
|
|
670
|
-
Object.defineProperty(ComponentMetadata.prototype, "viewBindings", {
|
|
671
|
-
get: function () { return this.viewProviders; },
|
|
664
|
+
get: function () { return this._viewProviders; },
|
|
672
665
|
enumerable: true,
|
|
673
666
|
configurable: true
|
|
674
667
|
});
|
|
@@ -686,6 +679,7 @@ exports.ComponentMetadata = ComponentMetadata;
|
|
|
686
679
|
*
|
|
687
680
|
* {@example core/ts/metadata/metadata.ts region='pipe'}
|
|
688
681
|
* @ts2dart_const
|
|
682
|
+
* @stable
|
|
689
683
|
*/
|
|
690
684
|
var PipeMetadata = (function (_super) {
|
|
691
685
|
__extends(PipeMetadata, _super);
|
|
@@ -744,6 +738,7 @@ exports.PipeMetadata = PipeMetadata;
|
|
|
744
738
|
* bootstrap(App);
|
|
745
739
|
* ```
|
|
746
740
|
* @ts2dart_const
|
|
741
|
+
* @stable
|
|
747
742
|
*/
|
|
748
743
|
var InputMetadata = (function () {
|
|
749
744
|
function InputMetadata(
|
|
@@ -797,6 +792,7 @@ exports.InputMetadata = InputMetadata;
|
|
|
797
792
|
* bootstrap(App);
|
|
798
793
|
* ```
|
|
799
794
|
* @ts2dart_const
|
|
795
|
+
* @stable
|
|
800
796
|
*/
|
|
801
797
|
var OutputMetadata = (function () {
|
|
802
798
|
function OutputMetadata(bindingPropertyName) {
|
|
@@ -840,6 +836,7 @@ exports.OutputMetadata = OutputMetadata;
|
|
|
840
836
|
* bootstrap(App);
|
|
841
837
|
* ```
|
|
842
838
|
* @ts2dart_const
|
|
839
|
+
* @stable
|
|
843
840
|
*/
|
|
844
841
|
var HostBindingMetadata = (function () {
|
|
845
842
|
function HostBindingMetadata(hostPropertyName) {
|
|
@@ -882,6 +879,7 @@ exports.HostBindingMetadata = HostBindingMetadata;
|
|
|
882
879
|
* bootstrap(App);
|
|
883
880
|
* ```
|
|
884
881
|
* @ts2dart_const
|
|
882
|
+
* @stable
|
|
885
883
|
*/
|
|
886
884
|
var HostListenerMetadata = (function () {
|
|
887
885
|
function HostListenerMetadata(eventName, args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directives.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/metadata/directives.ts"],"names":[],"mappings":";;;;;;AAIE,qBAA8B,uBAAuB,CAAC,CAAA;AACxD,yBAAiC,gBAAgB,CAAC,CAAA;AAElD,0BAAsC,+BAA+B,CAAC,CAAA;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;;;OAAA;IAC3E,mBAAC;AAAD,CAAC,AAZD,CAAkC,6BAAkB,GAYnD;AAZY,oBAAY,eAYxB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH;IACE;QACI;;WAEG;QACI,mBAA4B;QAA5B,wBAAmB,GAAnB,mBAAmB,CAAS;IAAG,CAAC;IAC7C,oBAAC;AAAD,CAAC,AAND,IAMC;AANY,qBAAa,gBAMzB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH;IACE,wBAAmB,mBAA4B;QAA5B,wBAAmB,GAAnB,mBAAmB,CAAS;IAAG,CAAC;IACrD,qBAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAc,iBAE1B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IACE,6BAAmB,gBAAyB;QAAzB,qBAAgB,GAAhB,gBAAgB,CAAS;IAAG,CAAC;IAClD,0BAAC;AAAD,CAAC,AAFD,IAEC;AAFY,2BAAmB,sBAE/B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;IACE,8BAAmB,SAAiB,EAAS,IAAe;QAAzC,cAAS,GAAT,SAAS,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAW;IAAG,CAAC;IAClE,2BAAC;AAAD,CAAC,AAFD,IAEC;AAFY,4BAAoB,uBAEhC,CAAA","sourcesContent":["interface DecoratorInvocation {\n type: Function;\n args?: any[];\n }\n import {isPresent, Type} from '../../src/facade/lang';\nimport {InjectableMetadata} from '../di/metadata';\nimport {ViewEncapsulation} from './view';\nimport {ChangeDetectionStrategy} from '../change_detection/constants';\n\n/**\n * Directives allow you to attach behavior to elements in the DOM.\n *\n * {@link DirectiveMetadata}s with an embedded view are called {@link ComponentMetadata}s.\n *\n * A directive consists of a single directive annotation and a controller class. When the\n * directive's `selector` matches\n * elements in the DOM, the following steps occur:\n *\n * 1. For each directive, the `ElementInjector` attempts to resolve the directive's constructor\n * arguments.\n * 2. Angular instantiates directives for each matched element using `ElementInjector` in a\n * depth-first order,\n * as declared in the HTML.\n *\n * ## Understanding How Injection Works\n *\n * There are three stages of injection resolution.\n * - *Pre-existing Injectors*:\n * - The terminal {@link Injector} cannot resolve dependencies. It either throws an error or, if\n * the dependency was\n * specified as `@Optional`, returns `null`.\n * - The platform injector resolves browser singleton resources, such as: cookies, title,\n * location, and others.\n * - *Component Injectors*: Each component instance has its own {@link Injector}, and they follow\n * the same parent-child hierarchy\n * as the component instances in the DOM.\n * - *Element Injectors*: Each component instance has a Shadow DOM. Within the Shadow DOM each\n * element has an `ElementInjector`\n * which follow the same parent-child hierarchy as the DOM elements themselves.\n *\n * When a template is instantiated, it also must instantiate the corresponding directives in a\n * depth-first order. The\n * current `ElementInjector` resolves the constructor dependencies for each directive.\n *\n * Angular then resolves dependencies as follows, according to the order in which they appear in the\n * {@link ViewMetadata}:\n *\n * 1. Dependencies on the current element\n * 2. Dependencies on element injectors and their parents until it encounters a Shadow DOM boundary\n * 3. Dependencies on component injectors and their parents until it encounters the root component\n * 4. Dependencies on pre-existing injectors\n *\n *\n * The `ElementInjector` can inject other directives, element-specific special objects, or it can\n * delegate to the parent\n * injector.\n *\n * To inject other directives, declare the constructor parameter as:\n * - `directive:DirectiveType`: a directive on the current element only\n * - `@Host() directive:DirectiveType`: any directive that matches the type between the current\n * element and the\n * Shadow DOM root.\n * - `@Query(DirectiveType) query:QueryList<DirectiveType>`: A live collection of direct child\n * directives.\n * - `@QueryDescendants(DirectiveType) query:QueryList<DirectiveType>`: A live collection of any\n * child directives.\n *\n * To inject element-specific special objects, declare the constructor parameter as:\n * - `element: ElementRef` to obtain a reference to logical element in the view.\n * - `viewContainer: ViewContainerRef` to control child template instantiation, for\n * {@link DirectiveMetadata} directives only\n * - `bindingPropagation: BindingPropagation` to control change detection in a more granular way.\n *\n * ### Example\n *\n * The following example demonstrates how dependency injection resolves constructor arguments in\n * practice.\n *\n *\n * Assume this HTML template:\n *\n * ```\n * <div dependency=\"1\">\n * <div dependency=\"2\">\n * <div dependency=\"3\" my-directive>\n * <div dependency=\"4\">\n * <div dependency=\"5\"></div>\n * </div>\n * <div dependency=\"6\"></div>\n * </div>\n * </div>\n * </div>\n * ```\n *\n * With the following `dependency` decorator and `SomeService` injectable class.\n *\n * ```\n * @Injectable()\n * class SomeService {\n * }\n *\n * @Directive({\n * selector: '[dependency]',\n * inputs: [\n * 'id: dependency'\n * ]\n * })\n * class Dependency {\n * id:string;\n * }\n * ```\n *\n * Let's step through the different ways in which `MyDirective` could be declared...\n *\n *\n * ### No injection\n *\n * Here the constructor is declared with no arguments, therefore nothing is injected into\n * `MyDirective`.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor() {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with no dependencies.\n *\n *\n * ### Component-level injection\n *\n * Directives can inject any injectable instance from the closest component injector or any of its\n * parents.\n *\n * Here, the constructor declares a parameter, `someService`, and injects the `SomeService` type\n * from the parent\n * component's injector.\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(someService: SomeService) {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with a dependency on `SomeService`.\n *\n *\n * ### Injecting a directive from the current element\n *\n * Directives can inject other directives declared on the current element.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(dependency: Dependency) {\n * expect(dependency.id).toEqual(3);\n * }\n * }\n * ```\n * This directive would be instantiated with `Dependency` declared at the same element, in this case\n * `dependency=\"3\"`.\n *\n * ### Injecting a directive from any ancestor elements\n *\n * Directives can inject other directives declared on any ancestor element (in the current Shadow\n * DOM), i.e. on the current element, the\n * parent element, or its parents.\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(@Host() dependency: Dependency) {\n * expect(dependency.id).toEqual(2);\n * }\n * }\n * ```\n *\n * `@Host` checks the current element, the parent, as well as its parents recursively. If\n * `dependency=\"2\"` didn't\n * exist on the direct parent, this injection would\n * have returned\n * `dependency=\"1\"`.\n *\n *\n * ### Injecting a live collection of direct child directives\n *\n *\n * A directive can also query for other child directives. Since parent directives are instantiated\n * before child directives, a directive can't simply inject the list of child directives. Instead,\n * the directive injects a {@link QueryList}, which updates its contents as children are added,\n * removed, or moved by a directive that uses a {@link ViewContainerRef} such as a `ngFor`, an\n * `ngIf`, or an `ngSwitch`.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(@Query(Dependency) dependencies:QueryList<Dependency>) {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with a {@link QueryList} which contains `Dependency` 4 and\n * `Dependency` 6. Here, `Dependency` 5 would not be included, because it is not a direct child.\n *\n * ### Injecting a live collection of descendant directives\n *\n * By passing the descendant flag to `@Query` above, we can include the children of the child\n * elements.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(@Query(Dependency, {descendants: true}) dependencies:QueryList<Dependency>) {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with a Query which would contain `Dependency` 4, 5 and 6.\n *\n * ### Optional injection\n *\n * The normal behavior of directives is to return an error when a specified dependency cannot be\n * resolved. If you\n * would like to inject `null` on unresolved dependency instead, you can annotate that dependency\n * with `@Optional()`.\n * This explicitly permits the author of a template to treat some of the surrounding directives as\n * optional.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(@Optional() dependency:Dependency) {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with a `Dependency` directive found on the current element.\n * If none can be\n * found, the injector supplies `null` instead of throwing an error.\n *\n * ### Example\n *\n * Here we use a decorator directive to simply define basic tool-tip behavior.\n *\n * ```\n * @Directive({\n * selector: '[tooltip]',\n * inputs: [\n * 'text: tooltip'\n * ],\n * host: {\n * '(mouseenter)': 'onMouseEnter()',\n * '(mouseleave)': 'onMouseLeave()'\n * }\n * })\n * class Tooltip{\n * text:string;\n * overlay:Overlay; // NOT YET IMPLEMENTED\n * overlayManager:OverlayManager; // NOT YET IMPLEMENTED\n *\n * constructor(overlayManager:OverlayManager) {\n * this.overlay = overlay;\n * }\n *\n * onMouseEnter() {\n * // exact signature to be determined\n * this.overlay = this.overlayManager.open(text, ...);\n * }\n *\n * onMouseLeave() {\n * this.overlay.close();\n * this.overlay = null;\n * }\n * }\n * ```\n * In our HTML template, we can then add this behavior to a `<div>` or any other element with the\n * `tooltip` selector,\n * like so:\n *\n * ```\n * <div tooltip=\"some text here\"></div>\n * ```\n *\n * Directives can also control the instantiation, destruction, and positioning of inline template\n * elements:\n *\n * A directive uses a {@link ViewContainerRef} to instantiate, insert, move, and destroy views at\n * runtime.\n * The {@link ViewContainerRef} is created as a result of `<template>` element, and represents a\n * location in the current view\n * where these actions are performed.\n *\n * Views are always created as children of the current {@link ViewMetadata}, and as siblings of the\n * `<template>` element. Thus a\n * directive in a child view cannot inject the directive that created it.\n *\n * Since directives that create views via ViewContainers are common in Angular, and using the full\n * `<template>` element syntax is wordy, Angular\n * also supports a shorthand notation: `<li *foo=\"bar\">` and `<li template=\"foo: bar\">` are\n * equivalent.\n *\n * Thus,\n *\n * ```\n * <ul>\n * <li *foo=\"bar\" title=\"text\"></li>\n * </ul>\n * ```\n *\n * Expands in use to:\n *\n * ```\n * <ul>\n * <template [foo]=\"bar\">\n * <li title=\"text\"></li>\n * </template>\n * </ul>\n * ```\n *\n * Notice that although the shorthand places `*foo=\"bar\"` within the `<li>` element, the binding for\n * the directive\n * controller is correctly instantiated on the `<template>` element rather than the `<li>` element.\n *\n * ## Lifecycle hooks\n *\n * When the directive class implements some {@link ../../guide/lifecycle-hooks.html} the callbacks\n * are called by the change detection at defined points in time during the life of the directive.\n *\n * ### Example\n *\n * Let's suppose we want to implement the `unless` behavior, to conditionally include a template.\n *\n * Here is a simple directive that triggers on an `unless` selector:\n *\n * ```\n * @Directive({\n * selector: '[unless]',\n * inputs: ['unless']\n * })\n * export class Unless {\n * viewContainer: ViewContainerRef;\n * templateRef: TemplateRef;\n * prevCondition: boolean;\n *\n * constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef) {\n * this.viewContainer = viewContainer;\n * this.templateRef = templateRef;\n * this.prevCondition = null;\n * }\n *\n * set unless(newCondition) {\n * if (newCondition && (isBlank(this.prevCondition) || !this.prevCondition)) {\n * this.prevCondition = true;\n * this.viewContainer.clear();\n * } else if (!newCondition && (isBlank(this.prevCondition) || this.prevCondition)) {\n * this.prevCondition = false;\n * this.viewContainer.create(this.templateRef);\n * }\n * }\n * }\n * ```\n *\n * We can then use this `unless` selector in a template:\n * ```\n * <ul>\n * <li *unless=\"expr\"></li>\n * </ul>\n * ```\n *\n * Once the directive instantiates the child view, the shorthand notation for the template expands\n * and the result is:\n *\n * ```\n * <ul>\n * <template [unless]=\"exp\">\n * <li></li>\n * </template>\n * <li></li>\n * </ul>\n * ```\n *\n * Note also that although the `<li></li>` template still exists inside the `<template></template>`,\n * the instantiated\n * view occurs on the second `<li></li>` which is a sibling to the `<template>` element.\n * @ts2dart_const\n */\nexport class DirectiveMetadata extends InjectableMetadata {\n /**\n * The CSS selector that triggers the instantiation of a directive.\n *\n * Angular only allows directives to trigger on CSS selectors that do not cross element\n * boundaries.\n *\n * `selector` may be declared as one of the following:\n *\n * - `element-name`: select by element name.\n * - `.class`: select by class name.\n * - `[attribute]`: select by attribute name.\n * - `[attribute=value]`: select by attribute name and value.\n * - `:not(sub_selector)`: select only if the element does not match the `sub_selector`.\n * - `selector1, selector2`: select if either `selector1` or `selector2` matches.\n *\n *\n * ### Example\n *\n * Suppose we have a directive with an `input[type=text]` selector.\n *\n * And the following HTML:\n *\n * ```html\n * <form>\n * <input type=\"text\">\n * <input type=\"radio\">\n * <form>\n * ```\n *\n * The directive would only be instantiated on the `<input type=\"text\">` element.\n *\n */\n selector: string;\n\n /**\n * Enumerates the set of data-bound input properties for a directive\n *\n * Angular automatically updates input properties during change detection.\n *\n * The `inputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property where the value is written.\n * - `bindingProperty` specifies the DOM property where the value is read from.\n *\n * When `bindingProperty` is not provided, it is assumed to be equal to `directiveProperty`.\n *\n * ### Example ([live demo](http://plnkr.co/edit/ivhfXY?p=preview))\n *\n * The following example creates a component with two data-bound properties.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * inputs: ['bankName', 'id: account-id'],\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * bankName: string;\n * id: string;\n *\n * // this property is not bound, and won't be automatically updated by Angular\n * normalizedBankName: string;\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <bank-account bank-name=\"RBC\" account-id=\"4747\"></bank-account>\n * `,\n * directives: [BankAccount]\n * })\n * class App {}\n *\n * bootstrap(App);\n * ```\n *\n */\n get inputs(): string[] {\n return isPresent(this._properties) && this._properties.length > 0 ? this._properties :\n this._inputs;\n }\n get properties(): string[] { return this.inputs; }\n private _inputs: string[];\n private _properties: string[];\n\n /**\n * Enumerates the set of event-bound output properties.\n *\n * When an output property emits an event, an event handler attached to that event\n * the template is invoked.\n *\n * The `outputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property that emits events.\n * - `bindingProperty` specifies the DOM property the event handler is attached to.\n *\n * ### Example ([live demo](http://plnkr.co/edit/d5CNq7?p=preview))\n *\n * ```typescript\n * @Directive({\n * selector: 'interval-dir',\n * outputs: ['everySecond', 'five5Secs: everyFiveSeconds']\n * })\n * class IntervalDir {\n * everySecond = new EventEmitter();\n * five5Secs = new EventEmitter();\n *\n * constructor() {\n * setInterval(() => this.everySecond.emit(\"event\"), 1000);\n * setInterval(() => this.five5Secs.emit(\"event\"), 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <interval-dir (everySecond)=\"everySecond()\" (everyFiveSeconds)=\"everyFiveSeconds()\">\n * </interval-dir>\n * `,\n * directives: [IntervalDir]\n * })\n * class App {\n * everySecond() { console.log('second'); }\n * everyFiveSeconds() { console.log('five seconds'); }\n * }\n * bootstrap(App);\n * ```\n *\n */\n get outputs(): string[] {\n return isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs;\n }\n get events(): string[] { return this.outputs; }\n private _outputs: string[];\n private _events: string[];\n\n /**\n * Specify the events, actions, properties and attributes related to the host element.\n *\n * ## Host Listeners\n *\n * Specifies which DOM events a directive listens to via a set of `(event)` to `method`\n * key-value pairs:\n *\n * - `event`: the DOM event that the directive listens to.\n * - `statement`: the statement to execute when the event occurs.\n * If the evaluation of the statement returns `false`, then `preventDefault`is applied on the DOM\n * event.\n *\n * To listen to global events, a target must be added to the event name.\n * The target can be `window`, `document` or `body`.\n *\n * When writing a directive event binding, you can also refer to the $event local variable.\n *\n * ### Example ([live demo](http://plnkr.co/edit/DlA5KU?p=preview))\n *\n * The following example declares a directive that attaches a click listener to the button and\n * counts clicks.\n *\n * ```typescript\n * @Directive({\n * selector: 'button[counting]',\n * host: {\n * '(click)': 'onClick($event.target)'\n * }\n * })\n * class CountClicks {\n * numberOfClicks = 0;\n *\n * onClick(btn) {\n * console.log(\"button\", btn, \"number of clicks:\", this.numberOfClicks++);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<button counting>Increment</button>`,\n * directives: [CountClicks]\n * })\n * class App {}\n *\n * bootstrap(App);\n * ```\n *\n * ## Host Property Bindings\n *\n * Specifies which DOM properties a directive updates.\n *\n * Angular automatically checks host property bindings during change detection.\n * If a binding changes, it will update the host element of the directive.\n *\n * ### Example ([live demo](http://plnkr.co/edit/gNg0ED?p=preview))\n *\n * The following example creates a directive that sets the `valid` and `invalid` classes\n * on the DOM element that has ngModel directive on it.\n *\n * ```typescript\n * @Directive({\n * selector: '[ngModel]',\n * host: {\n * '[class.valid]': 'valid',\n * '[class.invalid]': 'invalid'\n * }\n * })\n * class NgModelStatus {\n * constructor(public control:NgModel) {}\n * get valid { return this.control.valid; }\n * get invalid { return this.control.invalid; }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<input [(ngModel)]=\"prop\">`,\n * directives: [FORM_DIRECTIVES, NgModelStatus]\n * })\n * class App {\n * prop;\n * }\n *\n * bootstrap(App);\n * ```\n *\n * ## Attributes\n *\n * Specifies static attributes that should be propagated to a host element.\n *\n * ### Example\n *\n * In this example using `my-button` directive (ex.: `<div my-button></div>`) on a host element\n * (here: `<div>` ) will ensure that this element will get the \"button\" role.\n *\n * ```typescript\n * @Directive({\n * selector: '[my-button]',\n * host: {\n * 'role': 'button'\n * }\n * })\n * class MyButton {\n * }\n * ```\n */\n host: {[key: string]: string};\n\n /**\n * Defines the set of injectable objects that are visible to a Directive and its light DOM\n * children.\n *\n * ## Simple Example\n *\n * Here is an example of a class that can be injected:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @Directive({\n * selector: 'greet',\n * bindings: [\n * Greeter\n * ]\n * })\n * class HelloWorld {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n * ```\n */\n get providers(): any[] {\n return isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings :\n this._providers;\n }\n /** @deprecated */\n get bindings(): any[] { return this.providers; }\n private _providers: any[];\n private _bindings: any[];\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * ## Simple Example\n *\n * ```\n * @Directive({\n * selector: 'child-dir',\n * exportAs: 'child'\n * })\n * class ChildDir {\n * }\n *\n * @Component({\n * selector: 'main',\n * template: `<child-dir #c=\"child\"></child-dir>`,\n * directives: [ChildDir]\n * })\n * class MainComponent {\n * }\n *\n * ```\n */\n exportAs: string;\n\n // TODO: add an example after ContentChildren and ViewChildren are in master\n /**\n * Configures the queries that will be injected into the directive.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * ### Example\n *\n * ```\n * @Component({\n * selector: 'someDir',\n * queries: {\n * contentChildren: new ContentChildren(ChildDirective),\n * viewChildren: new ViewChildren(ChildDirective)\n * },\n * template: '<child-directive></child-directive>',\n * directives: [ChildDirective]\n * })\n * class SomeDir {\n * contentChildren: QueryList<ChildDirective>,\n * viewChildren: QueryList<ChildDirective>\n *\n * ngAfterContentInit() {\n * // contentChildren is set\n * }\n *\n * ngAfterViewInit() {\n * // viewChildren is set\n * }\n * }\n * ```\n */\n queries: {[key: string]: any};\n\n constructor({selector, inputs, outputs, properties, events, host, bindings, providers, exportAs,\n queries}: {\n selector?: string,\n inputs?: string[],\n outputs?: string[],\n properties?: string[],\n events?: string[],\n host?: {[key: string]: string},\n providers?: any[],\n /** @deprecated */ bindings?: any[],\n exportAs?: string,\n queries?: {[key: string]: any}\n } = {}) {\n super();\n this.selector = selector;\n this._inputs = inputs;\n this._properties = properties;\n this._outputs = outputs;\n this._events = events;\n this.host = host;\n this.exportAs = exportAs;\n this.queries = queries;\n this._providers = providers;\n this._bindings = bindings;\n }\n}\n\n/**\n * Declare reusable UI building blocks for an application.\n *\n * Each Angular component requires a single `@Component` annotation. The\n * `@Component`\n * annotation specifies when a component is instantiated, and which properties and hostListeners it\n * binds to.\n *\n * When a component is instantiated, Angular\n * - creates a shadow DOM for the component.\n * - loads the selected template into the shadow DOM.\n * - creates all the injectable objects configured with `providers` and `viewProviders`.\n *\n * All template expressions and statements are then evaluated against the component instance.\n *\n * For details on the `@View` annotation, see {@link ViewMetadata}.\n *\n * ## Lifecycle hooks\n *\n * When the component class implements some {@link ../../guide/lifecycle-hooks.html} the callbacks\n * are called by the change detection at defined points in time during the life of the component.\n *\n * ### Example\n *\n * {@example core/ts/metadata/metadata.ts region='component'}\n * @ts2dart_const\n */\nexport class ComponentMetadata extends DirectiveMetadata {\n /**\n * Defines the used change detection strategy.\n *\n * When a component is instantiated, Angular creates a change detector, which is responsible for\n * propagating the component's bindings.\n *\n * The `changeDetection` property defines, whether the change detection will be checked every time\n * or only when the component tells it to do so.\n */\n changeDetection: ChangeDetectionStrategy;\n\n /**\n * Defines the set of injectable objects that are visible to its view DOM children.\n *\n * ## Simple Example\n *\n * Here is an example of a class that can be injected:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @Directive({\n * selector: 'needs-greeter'\n * })\n * class NeedsGreeter {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n *\n * @Component({\n * selector: 'greet',\n * viewProviders: [\n * Greeter\n * ],\n * template: `<needs-greeter></needs-greeter>`,\n * directives: [NeedsGreeter]\n * })\n * class HelloWorld {\n * }\n *\n * ```\n */\n get viewProviders(): any[] {\n return isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings :\n this._viewProviders;\n }\n get viewBindings(): any[] { return this.viewProviders; }\n private _viewProviders: any[];\n private _viewBindings: any[];\n\n /**\n * The module id of the module that contains the component.\n * Needed to be able to resolve relative urls for templates and styles.\n * In Dart, this can be determined automatically and does not need to be set.\n * In CommonJS, this can always be set to `module.id`.\n *\n * ## Simple Example\n *\n * ```\n * @Directive({\n * selector: 'someDir',\n * moduleId: module.id\n * })\n * class SomeDir {\n * }\n *\n * ```\n */\n moduleId: string;\n\n templateUrl: string;\n\n template: string;\n\n styleUrls: string[];\n\n styles: string[];\n\n directives: Array<Type | any[]>;\n\n pipes: Array<Type | any[]>;\n\n encapsulation: ViewEncapsulation;\n\n constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId, bindings,\n providers, viewBindings, viewProviders,\n changeDetection = ChangeDetectionStrategy.Default, queries, templateUrl, template,\n styleUrls, styles, directives, pipes, encapsulation}: {\n selector?: string,\n inputs?: string[],\n outputs?: string[],\n properties?: string[],\n events?: string[],\n host?: {[key: string]: string},\n /** @deprecated */ bindings?: any[],\n providers?: any[],\n exportAs?: string,\n moduleId?: string,\n /** @deprecated */ viewBindings?: any[],\n viewProviders?: any[],\n queries?: {[key: string]: any},\n changeDetection?: ChangeDetectionStrategy,\n templateUrl?: string,\n template?: string,\n styleUrls?: string[],\n styles?: string[],\n directives?: Array<Type | any[]>,\n pipes?: Array<Type | any[]>,\n encapsulation?: ViewEncapsulation\n } = {}) {\n super({\n selector: selector,\n inputs: inputs,\n outputs: outputs,\n properties: properties,\n events: events,\n host: host,\n exportAs: exportAs,\n bindings: bindings,\n providers: providers,\n queries: queries\n });\n\n this.changeDetection = changeDetection;\n this._viewProviders = viewProviders;\n this._viewBindings = viewBindings;\n this.templateUrl = templateUrl;\n this.template = template;\n this.styleUrls = styleUrls;\n this.styles = styles;\n this.directives = directives;\n this.pipes = pipes;\n this.encapsulation = encapsulation;\n this.moduleId = moduleId;\n }\n}\n\n/**\n * Declare reusable pipe function.\n *\n * A \"pure\" pipe is only re-evaluated when either the input or any of the arguments change.\n *\n * When not specified, pipes default to being pure.\n *\n * ### Example\n *\n * {@example core/ts/metadata/metadata.ts region='pipe'}\n * @ts2dart_const\n */\nexport class PipeMetadata extends InjectableMetadata {\n name: string;\n /** @internal */\n _pure: boolean;\n\n constructor({name, pure}: {name: string, pure?: boolean}) {\n super();\n this.name = name;\n this._pure = pure;\n }\n\n get pure(): boolean { return isPresent(this._pure) ? this._pure : true; }\n}\n\n/**\n * Declares a data-bound input property.\n *\n * Angular automatically updates data-bound properties during change detection.\n *\n * `InputMetadata` takes an optional parameter that specifies the name\n * used when instantiating a component in the template. When not provided,\n * the name of the decorated property is used.\n *\n * ### Example\n *\n * The following example creates a component with two input properties.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * @Input() bankName: string;\n * @Input('account-id') id: string;\n *\n * // this property is not bound, and won't be automatically updated by Angular\n * normalizedBankName: string;\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <bank-account bank-name=\"RBC\" account-id=\"4747\"></bank-account>\n * `,\n * directives: [BankAccount]\n * })\n * class App {}\n *\n * bootstrap(App);\n * ```\n * @ts2dart_const\n */\nexport class InputMetadata {\n constructor(\n /**\n * Name used when instantiating a component in the template.\n */\n public bindingPropertyName?: string) {}\n}\n\n/**\n * Declares an event-bound output property.\n *\n * When an output property emits an event, an event handler attached to that event\n * the template is invoked.\n *\n * `OutputMetadata` takes an optional parameter that specifies the name\n * used when instantiating a component in the template. When not provided,\n * the name of the decorated property is used.\n *\n * ### Example\n *\n * ```typescript\n * @Directive({\n * selector: 'interval-dir',\n * })\n * class IntervalDir {\n * @Output() everySecond = new EventEmitter();\n * @Output('everyFiveSeconds') five5Secs = new EventEmitter();\n *\n * constructor() {\n * setInterval(() => this.everySecond.emit(\"event\"), 1000);\n * setInterval(() => this.five5Secs.emit(\"event\"), 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <interval-dir (everySecond)=\"everySecond()\" (everyFiveSeconds)=\"everyFiveSeconds()\">\n * </interval-dir>\n * `,\n * directives: [IntervalDir]\n * })\n * class App {\n * everySecond() { console.log('second'); }\n * everyFiveSeconds() { console.log('five seconds'); }\n * }\n * bootstrap(App);\n * ```\n * @ts2dart_const\n */\nexport class OutputMetadata {\n constructor(public bindingPropertyName?: string) {}\n}\n\n/**\n * Declares a host property binding.\n *\n * Angular automatically checks host property bindings during change detection.\n * If a binding changes, it will update the host element of the directive.\n *\n * `HostBindingMetadata` takes an optional parameter that specifies the property\n * name of the host element that will be updated. When not provided,\n * the class property name is used.\n *\n * ### Example\n *\n * The following example creates a directive that sets the `valid` and `invalid` classes\n * on the DOM element that has ngModel directive on it.\n *\n * ```typescript\n * @Directive({selector: '[ngModel]'})\n * class NgModelStatus {\n * constructor(public control:NgModel) {}\n * @HostBinding('class.valid') get valid { return this.control.valid; }\n * @HostBinding('class.invalid') get invalid { return this.control.invalid; }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<input [(ngModel)]=\"prop\">`,\n * directives: [FORM_DIRECTIVES, NgModelStatus]\n * })\n * class App {\n * prop;\n * }\n *\n * bootstrap(App);\n * ```\n * @ts2dart_const\n */\nexport class HostBindingMetadata {\n constructor(public hostPropertyName?: string) {}\n}\n\n/**\n * Declares a host listener.\n *\n * Angular will invoke the decorated method when the host element emits the specified event.\n *\n * If the decorated method returns `false`, then `preventDefault` is applied on the DOM\n * event.\n *\n * ### Example\n *\n * The following example declares a directive that attaches a click listener to the button and\n * counts clicks.\n *\n * ```typescript\n * @Directive({selector: 'button[counting]'})\n * class CountClicks {\n * numberOfClicks = 0;\n *\n * @HostListener('click', ['$event.target'])\n * onClick(btn) {\n * console.log(\"button\", btn, \"number of clicks:\", this.numberOfClicks++);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<button counting>Increment</button>`,\n * directives: [CountClicks]\n * })\n * class App {}\n *\n * bootstrap(App);\n * ```\n * @ts2dart_const\n */\nexport class HostListenerMetadata {\n constructor(public eventName: string, public args?: string[]) {}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"directives.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/metadata/directives.ts"],"names":[],"mappings":";;;;;;AACA,0BAAsC,+BAA+B,CAAC,CAAA;AACtE,yBAAiC,gBAAgB,CAAC,CAAA;AAClD,qBAA8B,gBAAgB,CAAC,CAAA;AAK/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AMzB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH;IACE,wBAAmB,mBAA4B;QAA5B,wBAAmB,GAAnB,mBAAmB,CAAS;IAAG,CAAC;IACrD,qBAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAc,iBAE1B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH;IACE,6BAAmB,gBAAyB;QAAzB,qBAAgB,GAAhB,gBAAgB,CAAS;IAAG,CAAC;IAClD,0BAAC;AAAD,CAAC,AAFD,IAEC;AAFY,2BAAmB,sBAE/B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IACE,8BAAmB,SAAiB,EAAS,IAAe;QAAzC,cAAS,GAAT,SAAS,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAW;IAAG,CAAC;IAClE,2BAAC;AAAD,CAAC,AAFD,IAEC;AAFY,4BAAoB,uBAEhC,CAAA","sourcesContent":["import {AnimationEntryMetadata} from '../animation/metadata';\nimport {ChangeDetectionStrategy} from '../change_detection/constants';\nimport {InjectableMetadata} from '../di/metadata';\nimport {Type, isPresent} from '../facade/lang';\n\nimport {ViewEncapsulation} from './view';\n\n\n/**\n * Directives allow you to attach behavior to elements in the DOM.\n *\n * {@link DirectiveMetadata}s with an embedded view are called {@link ComponentMetadata}s.\n *\n * A directive consists of a single directive annotation and a controller class. When the\n * directive's `selector` matches\n * elements in the DOM, the following steps occur:\n *\n * 1. For each directive, the `ElementInjector` attempts to resolve the directive's constructor\n * arguments.\n * 2. Angular instantiates directives for each matched element using `ElementInjector` in a\n * depth-first order,\n * as declared in the HTML.\n *\n * ## Understanding How Injection Works\n *\n * There are three stages of injection resolution.\n * - *Pre-existing Injectors*:\n * - The terminal {@link Injector} cannot resolve dependencies. It either throws an error or, if\n * the dependency was\n * specified as `@Optional`, returns `null`.\n * - The platform injector resolves browser singleton resources, such as: cookies, title,\n * location, and others.\n * - *Component Injectors*: Each component instance has its own {@link Injector}, and they follow\n * the same parent-child hierarchy\n * as the component instances in the DOM.\n * - *Element Injectors*: Each component instance has a Shadow DOM. Within the Shadow DOM each\n * element has an `ElementInjector`\n * which follow the same parent-child hierarchy as the DOM elements themselves.\n *\n * When a template is instantiated, it also must instantiate the corresponding directives in a\n * depth-first order. The\n * current `ElementInjector` resolves the constructor dependencies for each directive.\n *\n * Angular then resolves dependencies as follows, according to the order in which they appear in the\n * {@link ViewMetadata}:\n *\n * 1. Dependencies on the current element\n * 2. Dependencies on element injectors and their parents until it encounters a Shadow DOM boundary\n * 3. Dependencies on component injectors and their parents until it encounters the root component\n * 4. Dependencies on pre-existing injectors\n *\n *\n * The `ElementInjector` can inject other directives, element-specific special objects, or it can\n * delegate to the parent\n * injector.\n *\n * To inject other directives, declare the constructor parameter as:\n * - `directive:DirectiveType`: a directive on the current element only\n * - `@Host() directive:DirectiveType`: any directive that matches the type between the current\n * element and the\n * Shadow DOM root.\n * - `@Query(DirectiveType) query:QueryList<DirectiveType>`: A live collection of direct child\n * directives.\n * - `@QueryDescendants(DirectiveType) query:QueryList<DirectiveType>`: A live collection of any\n * child directives.\n *\n * To inject element-specific special objects, declare the constructor parameter as:\n * - `element: ElementRef` to obtain a reference to logical element in the view.\n * - `viewContainer: ViewContainerRef` to control child template instantiation, for\n * {@link DirectiveMetadata} directives only\n * - `bindingPropagation: BindingPropagation` to control change detection in a more granular way.\n *\n * ### Example\n *\n * The following example demonstrates how dependency injection resolves constructor arguments in\n * practice.\n *\n *\n * Assume this HTML template:\n *\n * ```\n * <div dependency=\"1\">\n * <div dependency=\"2\">\n * <div dependency=\"3\" my-directive>\n * <div dependency=\"4\">\n * <div dependency=\"5\"></div>\n * </div>\n * <div dependency=\"6\"></div>\n * </div>\n * </div>\n * </div>\n * ```\n *\n * With the following `dependency` decorator and `SomeService` injectable class.\n *\n * ```\n * @Injectable()\n * class SomeService {\n * }\n *\n * @Directive({\n * selector: '[dependency]',\n * inputs: [\n * 'id: dependency'\n * ]\n * })\n * class Dependency {\n * id:string;\n * }\n * ```\n *\n * Let's step through the different ways in which `MyDirective` could be declared...\n *\n *\n * ### No injection\n *\n * Here the constructor is declared with no arguments, therefore nothing is injected into\n * `MyDirective`.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor() {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with no dependencies.\n *\n *\n * ### Component-level injection\n *\n * Directives can inject any injectable instance from the closest component injector or any of its\n * parents.\n *\n * Here, the constructor declares a parameter, `someService`, and injects the `SomeService` type\n * from the parent\n * component's injector.\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(someService: SomeService) {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with a dependency on `SomeService`.\n *\n *\n * ### Injecting a directive from the current element\n *\n * Directives can inject other directives declared on the current element.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(dependency: Dependency) {\n * expect(dependency.id).toEqual(3);\n * }\n * }\n * ```\n * This directive would be instantiated with `Dependency` declared at the same element, in this case\n * `dependency=\"3\"`.\n *\n * ### Injecting a directive from any ancestor elements\n *\n * Directives can inject other directives declared on any ancestor element (in the current Shadow\n * DOM), i.e. on the current element, the\n * parent element, or its parents.\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(@Host() dependency: Dependency) {\n * expect(dependency.id).toEqual(2);\n * }\n * }\n * ```\n *\n * `@Host` checks the current element, the parent, as well as its parents recursively. If\n * `dependency=\"2\"` didn't\n * exist on the direct parent, this injection would\n * have returned\n * `dependency=\"1\"`.\n *\n *\n * ### Injecting a live collection of direct child directives\n *\n *\n * A directive can also query for other child directives. Since parent directives are instantiated\n * before child directives, a directive can't simply inject the list of child directives. Instead,\n * the directive injects a {@link QueryList}, which updates its contents as children are added,\n * removed, or moved by a directive that uses a {@link ViewContainerRef} such as a `ngFor`, an\n * `ngIf`, or an `ngSwitch`.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(@Query(Dependency) dependencies:QueryList<Dependency>) {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with a {@link QueryList} which contains `Dependency` 4 and\n * `Dependency` 6. Here, `Dependency` 5 would not be included, because it is not a direct child.\n *\n * ### Injecting a live collection of descendant directives\n *\n * By passing the descendant flag to `@Query` above, we can include the children of the child\n * elements.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(@Query(Dependency, {descendants: true}) dependencies:QueryList<Dependency>) {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with a Query which would contain `Dependency` 4, 5 and 6.\n *\n * ### Optional injection\n *\n * The normal behavior of directives is to return an error when a specified dependency cannot be\n * resolved. If you\n * would like to inject `null` on unresolved dependency instead, you can annotate that dependency\n * with `@Optional()`.\n * This explicitly permits the author of a template to treat some of the surrounding directives as\n * optional.\n *\n * ```\n * @Directive({ selector: '[my-directive]' })\n * class MyDirective {\n * constructor(@Optional() dependency:Dependency) {\n * }\n * }\n * ```\n *\n * This directive would be instantiated with a `Dependency` directive found on the current element.\n * If none can be\n * found, the injector supplies `null` instead of throwing an error.\n *\n * ### Example\n *\n * Here we use a decorator directive to simply define basic tool-tip behavior.\n *\n * ```\n * @Directive({\n * selector: '[tooltip]',\n * inputs: [\n * 'text: tooltip'\n * ],\n * host: {\n * '(mouseenter)': 'onMouseEnter()',\n * '(mouseleave)': 'onMouseLeave()'\n * }\n * })\n * class Tooltip{\n * text:string;\n * overlay:Overlay; // NOT YET IMPLEMENTED\n * overlayManager:OverlayManager; // NOT YET IMPLEMENTED\n *\n * constructor(overlayManager:OverlayManager) {\n * this.overlay = overlay;\n * }\n *\n * onMouseEnter() {\n * // exact signature to be determined\n * this.overlay = this.overlayManager.open(text, ...);\n * }\n *\n * onMouseLeave() {\n * this.overlay.close();\n * this.overlay = null;\n * }\n * }\n * ```\n * In our HTML template, we can then add this behavior to a `<div>` or any other element with the\n * `tooltip` selector,\n * like so:\n *\n * ```\n * <div tooltip=\"some text here\"></div>\n * ```\n *\n * Directives can also control the instantiation, destruction, and positioning of inline template\n * elements:\n *\n * A directive uses a {@link ViewContainerRef} to instantiate, insert, move, and destroy views at\n * runtime.\n * The {@link ViewContainerRef} is created as a result of `<template>` element, and represents a\n * location in the current view\n * where these actions are performed.\n *\n * Views are always created as children of the current {@link ViewMetadata}, and as siblings of the\n * `<template>` element. Thus a\n * directive in a child view cannot inject the directive that created it.\n *\n * Since directives that create views via ViewContainers are common in Angular, and using the full\n * `<template>` element syntax is wordy, Angular\n * also supports a shorthand notation: `<li *foo=\"bar\">` and `<li template=\"foo: bar\">` are\n * equivalent.\n *\n * Thus,\n *\n * ```\n * <ul>\n * <li *foo=\"bar\" title=\"text\"></li>\n * </ul>\n * ```\n *\n * Expands in use to:\n *\n * ```\n * <ul>\n * <template [foo]=\"bar\">\n * <li title=\"text\"></li>\n * </template>\n * </ul>\n * ```\n *\n * Notice that although the shorthand places `*foo=\"bar\"` within the `<li>` element, the binding for\n * the directive\n * controller is correctly instantiated on the `<template>` element rather than the `<li>` element.\n *\n * ## Lifecycle hooks\n *\n * When the directive class implements some {@link ../../guide/lifecycle-hooks.html} the callbacks\n * are called by the change detection at defined points in time during the life of the directive.\n *\n * ### Example\n *\n * Let's suppose we want to implement the `unless` behavior, to conditionally include a template.\n *\n * Here is a simple directive that triggers on an `unless` selector:\n *\n * ```\n * @Directive({\n * selector: '[unless]',\n * inputs: ['unless']\n * })\n * export class Unless {\n * viewContainer: ViewContainerRef;\n * templateRef: TemplateRef;\n * prevCondition: boolean;\n *\n * constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef) {\n * this.viewContainer = viewContainer;\n * this.templateRef = templateRef;\n * this.prevCondition = null;\n * }\n *\n * set unless(newCondition) {\n * if (newCondition && (isBlank(this.prevCondition) || !this.prevCondition)) {\n * this.prevCondition = true;\n * this.viewContainer.clear();\n * } else if (!newCondition && (isBlank(this.prevCondition) || this.prevCondition)) {\n * this.prevCondition = false;\n * this.viewContainer.create(this.templateRef);\n * }\n * }\n * }\n * ```\n *\n * We can then use this `unless` selector in a template:\n * ```\n * <ul>\n * <li *unless=\"expr\"></li>\n * </ul>\n * ```\n *\n * Once the directive instantiates the child view, the shorthand notation for the template expands\n * and the result is:\n *\n * ```\n * <ul>\n * <template [unless]=\"exp\">\n * <li></li>\n * </template>\n * <li></li>\n * </ul>\n * ```\n *\n * Note also that although the `<li></li>` template still exists inside the `<template></template>`,\n * the instantiated\n * view occurs on the second `<li></li>` which is a sibling to the `<template>` element.\n * @ts2dart_const\n * @stable\n */\nexport class DirectiveMetadata extends InjectableMetadata {\n /**\n * The CSS selector that triggers the instantiation of a directive.\n *\n * Angular only allows directives to trigger on CSS selectors that do not cross element\n * boundaries.\n *\n * `selector` may be declared as one of the following:\n *\n * - `element-name`: select by element name.\n * - `.class`: select by class name.\n * - `[attribute]`: select by attribute name.\n * - `[attribute=value]`: select by attribute name and value.\n * - `:not(sub_selector)`: select only if the element does not match the `sub_selector`.\n * - `selector1, selector2`: select if either `selector1` or `selector2` matches.\n *\n *\n * ### Example\n *\n * Suppose we have a directive with an `input[type=text]` selector.\n *\n * And the following HTML:\n *\n * ```html\n * <form>\n * <input type=\"text\">\n * <input type=\"radio\">\n * <form>\n * ```\n *\n * The directive would only be instantiated on the `<input type=\"text\">` element.\n *\n */\n selector: string;\n\n /**\n * Enumerates the set of data-bound input properties for a directive\n *\n * Angular automatically updates input properties during change detection.\n *\n * The `inputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property where the value is written.\n * - `bindingProperty` specifies the DOM property where the value is read from.\n *\n * When `bindingProperty` is not provided, it is assumed to be equal to `directiveProperty`.\n *\n * ### Example ([live demo](http://plnkr.co/edit/ivhfXY?p=preview))\n *\n * The following example creates a component with two data-bound properties.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * inputs: ['bankName', 'id: account-id'],\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * bankName: string;\n * id: string;\n *\n * // this property is not bound, and won't be automatically updated by Angular\n * normalizedBankName: string;\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <bank-account bank-name=\"RBC\" account-id=\"4747\"></bank-account>\n * `,\n * directives: [BankAccount]\n * })\n * class App {}\n *\n * bootstrap(App);\n * ```\n *\n */\n get inputs(): string[] {\n return isPresent(this._properties) && this._properties.length > 0 ? this._properties :\n this._inputs;\n }\n /**\n * Use `inputs` instead\n *\n * @deprecated\n */\n get properties(): string[] { return this.inputs; }\n private _inputs: string[];\n private _properties: string[];\n\n /**\n * Enumerates the set of event-bound output properties.\n *\n * When an output property emits an event, an event handler attached to that event\n * the template is invoked.\n *\n * The `outputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property that emits events.\n * - `bindingProperty` specifies the DOM property the event handler is attached to.\n *\n * ### Example ([live demo](http://plnkr.co/edit/d5CNq7?p=preview))\n *\n * ```typescript\n * @Directive({\n * selector: 'interval-dir',\n * outputs: ['everySecond', 'five5Secs: everyFiveSeconds']\n * })\n * class IntervalDir {\n * everySecond = new EventEmitter();\n * five5Secs = new EventEmitter();\n *\n * constructor() {\n * setInterval(() => this.everySecond.emit(\"event\"), 1000);\n * setInterval(() => this.five5Secs.emit(\"event\"), 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <interval-dir (everySecond)=\"everySecond()\" (everyFiveSeconds)=\"everyFiveSeconds()\">\n * </interval-dir>\n * `,\n * directives: [IntervalDir]\n * })\n * class App {\n * everySecond() { console.log('second'); }\n * everyFiveSeconds() { console.log('five seconds'); }\n * }\n * bootstrap(App);\n * ```\n *\n */\n get outputs(): string[] {\n return isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs;\n }\n /**\n * Use `outputs` instead\n *\n * @deprecated\n */\n get events(): string[] { return this.outputs; }\n private _outputs: string[];\n private _events: string[];\n\n /**\n * Specify the events, actions, properties and attributes related to the host element.\n *\n * ## Host Listeners\n *\n * Specifies which DOM events a directive listens to via a set of `(event)` to `method`\n * key-value pairs:\n *\n * - `event`: the DOM event that the directive listens to.\n * - `statement`: the statement to execute when the event occurs.\n * If the evaluation of the statement returns `false`, then `preventDefault`is applied on the DOM\n * event.\n *\n * To listen to global events, a target must be added to the event name.\n * The target can be `window`, `document` or `body`.\n *\n * When writing a directive event binding, you can also refer to the $event local variable.\n *\n * ### Example ([live demo](http://plnkr.co/edit/DlA5KU?p=preview))\n *\n * The following example declares a directive that attaches a click listener to the button and\n * counts clicks.\n *\n * ```typescript\n * @Directive({\n * selector: 'button[counting]',\n * host: {\n * '(click)': 'onClick($event.target)'\n * }\n * })\n * class CountClicks {\n * numberOfClicks = 0;\n *\n * onClick(btn) {\n * console.log(\"button\", btn, \"number of clicks:\", this.numberOfClicks++);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<button counting>Increment</button>`,\n * directives: [CountClicks]\n * })\n * class App {}\n *\n * bootstrap(App);\n * ```\n *\n * ## Host Property Bindings\n *\n * Specifies which DOM properties a directive updates.\n *\n * Angular automatically checks host property bindings during change detection.\n * If a binding changes, it will update the host element of the directive.\n *\n * ### Example ([live demo](http://plnkr.co/edit/gNg0ED?p=preview))\n *\n * The following example creates a directive that sets the `valid` and `invalid` classes\n * on the DOM element that has ngModel directive on it.\n *\n * ```typescript\n * @Directive({\n * selector: '[ngModel]',\n * host: {\n * '[class.valid]': 'valid',\n * '[class.invalid]': 'invalid'\n * }\n * })\n * class NgModelStatus {\n * constructor(public control:NgModel) {}\n * get valid { return this.control.valid; }\n * get invalid { return this.control.invalid; }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<input [(ngModel)]=\"prop\">`,\n * directives: [FORM_DIRECTIVES, NgModelStatus]\n * })\n * class App {\n * prop;\n * }\n *\n * bootstrap(App);\n * ```\n *\n * ## Attributes\n *\n * Specifies static attributes that should be propagated to a host element.\n *\n * ### Example\n *\n * In this example using `my-button` directive (ex.: `<div my-button></div>`) on a host element\n * (here: `<div>` ) will ensure that this element will get the \"button\" role.\n *\n * ```typescript\n * @Directive({\n * selector: '[my-button]',\n * host: {\n * 'role': 'button'\n * }\n * })\n * class MyButton {\n * }\n * ```\n */\n host: {[key: string]: string};\n\n /**\n * Defines the set of injectable objects that are visible to a Directive and its light DOM\n * children.\n *\n * ## Simple Example\n *\n * Here is an example of a class that can be injected:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @Directive({\n * selector: 'greet',\n * providers: [\n * Greeter\n * ]\n * })\n * class HelloWorld {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n * ```\n */\n get providers(): any[] { return this._providers; }\n private _providers: any[];\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * ## Simple Example\n *\n * ```\n * @Directive({\n * selector: 'child-dir',\n * exportAs: 'child'\n * })\n * class ChildDir {\n * }\n *\n * @Component({\n * selector: 'main',\n * template: `<child-dir #c=\"child\"></child-dir>`,\n * directives: [ChildDir]\n * })\n * class MainComponent {\n * }\n *\n * ```\n */\n exportAs: string;\n\n // TODO: add an example after ContentChildren and ViewChildren are in master\n /**\n * Configures the queries that will be injected into the directive.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * ### Example\n *\n * ```\n * @Component({\n * selector: 'someDir',\n * queries: {\n * contentChildren: new ContentChildren(ChildDirective),\n * viewChildren: new ViewChildren(ChildDirective)\n * },\n * template: '<child-directive></child-directive>',\n * directives: [ChildDirective]\n * })\n * class SomeDir {\n * contentChildren: QueryList<ChildDirective>,\n * viewChildren: QueryList<ChildDirective>\n *\n * ngAfterContentInit() {\n * // contentChildren is set\n * }\n *\n * ngAfterViewInit() {\n * // viewChildren is set\n * }\n * }\n * ```\n */\n queries: {[key: string]: any};\n\n constructor({selector, inputs, outputs, properties, events, host, providers, exportAs, queries}: {\n selector?: string,\n inputs?: string[],\n outputs?: string[],\n /** @deprecated */ properties?: string[],\n /** @deprecated */ events?: string[],\n host?: {[key: string]: string},\n providers?: any[],\n exportAs?: string,\n queries?: {[key: string]: any}\n } = {}) {\n super();\n this.selector = selector;\n this._inputs = inputs;\n this._properties = properties;\n this._outputs = outputs;\n this._events = events;\n this.host = host;\n this.exportAs = exportAs;\n this.queries = queries;\n this._providers = providers;\n }\n}\n\n/**\n * Declare reusable UI building blocks for an application.\n *\n * Each Angular component requires a single `@Component` annotation. The\n * `@Component`\n * annotation specifies when a component is instantiated, and which properties and hostListeners it\n * binds to.\n *\n * When a component is instantiated, Angular\n * - creates a shadow DOM for the component.\n * - loads the selected template into the shadow DOM.\n * - creates all the injectable objects configured with `providers` and `viewProviders`.\n *\n * All template expressions and statements are then evaluated against the component instance.\n *\n * For details on the `@View` annotation, see {@link ViewMetadata}.\n *\n * ## Lifecycle hooks\n *\n * When the component class implements some {@link ../../guide/lifecycle-hooks.html} the callbacks\n * are called by the change detection at defined points in time during the life of the component.\n *\n * ### Example\n *\n * {@example core/ts/metadata/metadata.ts region='component'}\n * @ts2dart_const\n * @stable\n */\nexport class ComponentMetadata extends DirectiveMetadata {\n /**\n * Defines the used change detection strategy.\n *\n * When a component is instantiated, Angular creates a change detector, which is responsible for\n * propagating the component's bindings.\n *\n * The `changeDetection` property defines, whether the change detection will be checked every time\n * or only when the component tells it to do so.\n */\n changeDetection: ChangeDetectionStrategy;\n\n /**\n * Defines the set of injectable objects that are visible to its view DOM children.\n *\n * ## Simple Example\n *\n * Here is an example of a class that can be injected:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @Directive({\n * selector: 'needs-greeter'\n * })\n * class NeedsGreeter {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n *\n * @Component({\n * selector: 'greet',\n * viewProviders: [\n * Greeter\n * ],\n * template: `<needs-greeter></needs-greeter>`,\n * directives: [NeedsGreeter]\n * })\n * class HelloWorld {\n * }\n *\n * ```\n */\n get viewProviders(): any[] { return this._viewProviders; }\n private _viewProviders: any[];\n\n /**\n * The module id of the module that contains the component.\n * Needed to be able to resolve relative urls for templates and styles.\n * In CommonJS, this can always be set to `module.id`, similarly SystemJS exposes `__moduleName`\n * variable within each module.\n *\n * In Dart, this can be determined automatically and does not need to be set.\n\n *\n * ## Simple Example\n *\n * ```\n * @Directive({\n * selector: 'someDir',\n * moduleId: module.id\n * })\n * class SomeDir {\n * }\n *\n * ```\n */\n moduleId: string;\n\n templateUrl: string;\n\n template: string;\n\n styleUrls: string[];\n\n styles: string[];\n\n /**\n * Animations are defined on components via an animation-like DSL. This DSL approach to describing\n * animations allows for a flexibility that both benefits developers and the framework.\n *\n * Animations work by listening on state changes that occur on an element within\n * the template. When a state change occurs, Angular can then take advantage and animate the\n * arc in between. This works similar to how CSS transitions work, however, by having a\n * programmatic DSL, animations are not limited to environments that are DOM-specific.\n * (Angular can also perform optimizations behind the scenes to make animations more performant.)\n *\n * For animations to be available for use, animation state changes are placed within\n * {@link trigger animation triggers} which are housed inside of the `animations` annotation\n * metadata. Within a trigger both {@link state state} and {@link transition transition} entries\n * can be placed.\n *\n * ```typescript\n * @Component({\n * selector: 'animation-cmp',\n * templateUrl: 'animation-cmp.html',\n * animations: [\n * // this here is our animation trigger that\n * // will contain our state change animations.\n * trigger('myTriggerName', [\n * // the styles defined for the `on` and `off`\n * // states declared below are persisted on the\n * // element once the animation completes.\n * state('on', style({ opacity: 1 }),\n * state('off', style({ opacity: 0 }),\n *\n * // this here is our animation that kicks off when\n * // this state change jump is true\n * transition('on => off', [\n * animate(\"1s\")\n * ])\n * ])\n * ]\n * })\n * ```\n *\n * As depicted in the code above, a group of related animation states are all contained within\n * an animation `trigger` (the code example above called the trigger `myTriggerName`).\n * When a trigger is created then it can be bound onto an element within the component's\n * template via a property prefixed by an `@` symbol followed by trigger name and an expression\n * that\n * is used to determine the state value for that trigger.\n *\n * ```html\n * <!-- animation-cmp.html -->\n * <div @myTriggerName=\"expression\">...</div>\n * ```\n *\n * For state changes to be executed, the `expression` value must change value from its existing\n * value\n * to something that we have set an animation to animate on (in the example above we are listening\n * to a change of state between `on` and `off`). The `expression` value attached to the trigger\n * must be something that can be evaluated with the template/component context.\n *\n * ### DSL Animation Functions\n *\n * Please visit each of the animation DSL functions listed below to gain a better understanding\n * of how and why they are used for crafting animations in Angular2:\n *\n * - {@link trigger trigger()}\n * - {@link state state()}\n * - {@link transition transition()}\n * - {@link group group()}\n * - {@link sequence sequence()}\n * - {@link style style()}\n * - {@link animate animate()}\n * - {@link keyframes keyframes()}\n */\n animations: AnimationEntryMetadata[];\n\n directives: Array<Type|any[]>;\n\n pipes: Array<Type|any[]>;\n\n encapsulation: ViewEncapsulation;\n\n constructor({selector,\n inputs,\n outputs,\n properties,\n events,\n host,\n exportAs,\n moduleId,\n providers,\n viewProviders,\n changeDetection = ChangeDetectionStrategy.Default,\n queries,\n templateUrl,\n template,\n styleUrls,\n styles,\n animations,\n directives,\n pipes,\n encapsulation}: {\n selector?: string,\n inputs?: string[],\n outputs?: string[],\n /** @deprecated */ properties?: string[],\n /** @deprecated */ events?: string[],\n host?: {[key: string]: string},\n providers?: any[],\n exportAs?: string,\n moduleId?: string,\n viewProviders?: any[],\n queries?: {[key: string]: any},\n changeDetection?: ChangeDetectionStrategy,\n templateUrl?: string,\n template?: string,\n styleUrls?: string[],\n styles?: string[],\n animations?: AnimationEntryMetadata[],\n directives?: Array<Type|any[]>,\n pipes?: Array<Type|any[]>,\n encapsulation?: ViewEncapsulation\n } = {}) {\n super({\n selector: selector,\n inputs: inputs,\n outputs: outputs,\n properties: properties,\n events: events,\n host: host,\n exportAs: exportAs,\n providers: providers,\n queries: queries\n });\n\n this.changeDetection = changeDetection;\n this._viewProviders = viewProviders;\n this.templateUrl = templateUrl;\n this.template = template;\n this.styleUrls = styleUrls;\n this.styles = styles;\n this.directives = directives;\n this.pipes = pipes;\n this.encapsulation = encapsulation;\n this.moduleId = moduleId;\n this.animations = animations;\n }\n}\n\n/**\n * Declare reusable pipe function.\n *\n * A \"pure\" pipe is only re-evaluated when either the input or any of the arguments change.\n *\n * When not specified, pipes default to being pure.\n *\n * ### Example\n *\n * {@example core/ts/metadata/metadata.ts region='pipe'}\n * @ts2dart_const\n * @stable\n */\nexport class PipeMetadata extends InjectableMetadata {\n name: string;\n /** @internal */\n _pure: boolean;\n\n constructor({name, pure}: {name: string, pure?: boolean}) {\n super();\n this.name = name;\n this._pure = pure;\n }\n\n get pure(): boolean { return isPresent(this._pure) ? this._pure : true; }\n}\n\n/**\n * Declares a data-bound input property.\n *\n * Angular automatically updates data-bound properties during change detection.\n *\n * `InputMetadata` takes an optional parameter that specifies the name\n * used when instantiating a component in the template. When not provided,\n * the name of the decorated property is used.\n *\n * ### Example\n *\n * The following example creates a component with two input properties.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * @Input() bankName: string;\n * @Input('account-id') id: string;\n *\n * // this property is not bound, and won't be automatically updated by Angular\n * normalizedBankName: string;\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <bank-account bank-name=\"RBC\" account-id=\"4747\"></bank-account>\n * `,\n * directives: [BankAccount]\n * })\n * class App {}\n *\n * bootstrap(App);\n * ```\n * @ts2dart_const\n * @stable\n */\nexport class InputMetadata {\n constructor(\n /**\n * Name used when instantiating a component in the template.\n */\n public bindingPropertyName?: string) {}\n}\n\n/**\n * Declares an event-bound output property.\n *\n * When an output property emits an event, an event handler attached to that event\n * the template is invoked.\n *\n * `OutputMetadata` takes an optional parameter that specifies the name\n * used when instantiating a component in the template. When not provided,\n * the name of the decorated property is used.\n *\n * ### Example\n *\n * ```typescript\n * @Directive({\n * selector: 'interval-dir',\n * })\n * class IntervalDir {\n * @Output() everySecond = new EventEmitter();\n * @Output('everyFiveSeconds') five5Secs = new EventEmitter();\n *\n * constructor() {\n * setInterval(() => this.everySecond.emit(\"event\"), 1000);\n * setInterval(() => this.five5Secs.emit(\"event\"), 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <interval-dir (everySecond)=\"everySecond()\" (everyFiveSeconds)=\"everyFiveSeconds()\">\n * </interval-dir>\n * `,\n * directives: [IntervalDir]\n * })\n * class App {\n * everySecond() { console.log('second'); }\n * everyFiveSeconds() { console.log('five seconds'); }\n * }\n * bootstrap(App);\n * ```\n * @ts2dart_const\n * @stable\n */\nexport class OutputMetadata {\n constructor(public bindingPropertyName?: string) {}\n}\n\n/**\n * Declares a host property binding.\n *\n * Angular automatically checks host property bindings during change detection.\n * If a binding changes, it will update the host element of the directive.\n *\n * `HostBindingMetadata` takes an optional parameter that specifies the property\n * name of the host element that will be updated. When not provided,\n * the class property name is used.\n *\n * ### Example\n *\n * The following example creates a directive that sets the `valid` and `invalid` classes\n * on the DOM element that has ngModel directive on it.\n *\n * ```typescript\n * @Directive({selector: '[ngModel]'})\n * class NgModelStatus {\n * constructor(public control:NgModel) {}\n * @HostBinding('class.valid') get valid { return this.control.valid; }\n * @HostBinding('class.invalid') get invalid { return this.control.invalid; }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<input [(ngModel)]=\"prop\">`,\n * directives: [FORM_DIRECTIVES, NgModelStatus]\n * })\n * class App {\n * prop;\n * }\n *\n * bootstrap(App);\n * ```\n * @ts2dart_const\n * @stable\n */\nexport class HostBindingMetadata {\n constructor(public hostPropertyName?: string) {}\n}\n\n/**\n * Declares a host listener.\n *\n * Angular will invoke the decorated method when the host element emits the specified event.\n *\n * If the decorated method returns `false`, then `preventDefault` is applied on the DOM\n * event.\n *\n * ### Example\n *\n * The following example declares a directive that attaches a click listener to the button and\n * counts clicks.\n *\n * ```typescript\n * @Directive({selector: 'button[counting]'})\n * class CountClicks {\n * numberOfClicks = 0;\n *\n * @HostListener('click', ['$event.target'])\n * onClick(btn) {\n * console.log(\"button\", btn, \"number of clicks:\", this.numberOfClicks++);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<button counting>Increment</button>`,\n * directives: [CountClicks]\n * })\n * class App {}\n *\n * bootstrap(App);\n * ```\n * @ts2dart_const\n * @stable\n */\nexport class HostListenerMetadata {\n constructor(public eventName: string, public args?: string[]) {}\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|