@angular/core 0.0.0-6 → 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} +6500 -4671
- 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 +102 -10
- package/esm/private_export.js +41 -9
- 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 +4 -4
- package/esm/src/linker/view_utils.js +25 -22
- 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.d.ts +22 -0
- package/esm/src/security.js +23 -0
- package/esm/src/security.js.map +1 -0
- 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 +102 -10
- package/private_export.js +41 -9
- 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 +4 -4
- package/src/linker/view_utils.js +25 -22
- 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.d.ts +22 -0
- package/src/security.js +28 -0
- package/src/security.js.map +1 -0
- 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
- package/esm/core.umd.js.map +0 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @stable
|
|
3
|
+
*/
|
|
1
4
|
export var LifecycleHooks;
|
|
2
5
|
(function (LifecycleHooks) {
|
|
3
6
|
LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit";
|
|
@@ -9,17 +12,468 @@ export var LifecycleHooks;
|
|
|
9
12
|
LifecycleHooks[LifecycleHooks["AfterViewInit"] = 6] = "AfterViewInit";
|
|
10
13
|
LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked";
|
|
11
14
|
})(LifecycleHooks || (LifecycleHooks = {}));
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
15
|
export var LIFECYCLE_HOOKS_VALUES = [
|
|
16
|
-
LifecycleHooks.OnInit,
|
|
17
|
-
LifecycleHooks.
|
|
18
|
-
LifecycleHooks.DoCheck,
|
|
19
|
-
LifecycleHooks.OnChanges,
|
|
20
|
-
LifecycleHooks.AfterContentInit,
|
|
21
|
-
LifecycleHooks.AfterContentChecked,
|
|
22
|
-
LifecycleHooks.AfterViewInit,
|
|
16
|
+
LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges,
|
|
17
|
+
LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit,
|
|
23
18
|
LifecycleHooks.AfterViewChecked
|
|
24
19
|
];
|
|
20
|
+
/**
|
|
21
|
+
* Lifecycle hooks are guaranteed to be called in the following order:
|
|
22
|
+
* - `OnChanges` (if any bindings have changed),
|
|
23
|
+
* - `OnInit` (after the first check only),
|
|
24
|
+
* - `DoCheck`,
|
|
25
|
+
* - `AfterContentInit`,
|
|
26
|
+
* - `AfterContentChecked`,
|
|
27
|
+
* - `AfterViewInit`,
|
|
28
|
+
* - `AfterViewChecked`,
|
|
29
|
+
* - `OnDestroy` (at the very end before destruction)
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Implement this interface to get notified when any data-bound property of your directive changes.
|
|
33
|
+
*
|
|
34
|
+
* `ngOnChanges` is called right after the data-bound properties have been checked and before view
|
|
35
|
+
* and content children are checked if at least one of them has changed.
|
|
36
|
+
*
|
|
37
|
+
* The `changes` parameter contains an entry for each of the changed data-bound property. The key is
|
|
38
|
+
* the property name and the value is an instance of {@link SimpleChange}.
|
|
39
|
+
*
|
|
40
|
+
* ### Example ([live example](http://plnkr.co/edit/AHrB6opLqHDBPkt4KpdT?p=preview)):
|
|
41
|
+
*
|
|
42
|
+
* ```typescript
|
|
43
|
+
* @Component({
|
|
44
|
+
* selector: 'my-cmp',
|
|
45
|
+
* template: `<p>myProp = {{myProp}}</p>`
|
|
46
|
+
* })
|
|
47
|
+
* class MyComponent implements OnChanges {
|
|
48
|
+
* @Input() myProp: any;
|
|
49
|
+
*
|
|
50
|
+
* ngOnChanges(changes: SimpleChanges) {
|
|
51
|
+
* console.log('ngOnChanges - myProp = ' + changes['myProp'].currentValue);
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
*
|
|
55
|
+
* @Component({
|
|
56
|
+
* selector: 'app',
|
|
57
|
+
* template: `
|
|
58
|
+
* <button (click)="value = value + 1">Change MyComponent</button>
|
|
59
|
+
* <my-cmp [my-prop]="value"></my-cmp>`,
|
|
60
|
+
* directives: [MyComponent]
|
|
61
|
+
* })
|
|
62
|
+
* export class App {
|
|
63
|
+
* value = 0;
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
67
|
+
* ```
|
|
68
|
+
* @stable
|
|
69
|
+
*/
|
|
70
|
+
export class OnChanges {
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Implement this interface to execute custom initialization logic after your directive's
|
|
74
|
+
* data-bound properties have been initialized.
|
|
75
|
+
*
|
|
76
|
+
* `ngOnInit` is called right after the directive's data-bound properties have been checked for the
|
|
77
|
+
* first time, and before any of its children have been checked. It is invoked only once when the
|
|
78
|
+
* directive is instantiated.
|
|
79
|
+
*
|
|
80
|
+
* ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview))
|
|
81
|
+
*
|
|
82
|
+
* ```typescript
|
|
83
|
+
* @Component({
|
|
84
|
+
* selector: 'my-cmp',
|
|
85
|
+
* template: `<p>my-component</p>`
|
|
86
|
+
* })
|
|
87
|
+
* class MyComponent implements OnInit, OnDestroy {
|
|
88
|
+
* ngOnInit() {
|
|
89
|
+
* console.log('ngOnInit');
|
|
90
|
+
* }
|
|
91
|
+
*
|
|
92
|
+
* ngOnDestroy() {
|
|
93
|
+
* console.log('ngOnDestroy');
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
*
|
|
97
|
+
* @Component({
|
|
98
|
+
* selector: 'app',
|
|
99
|
+
* template: `
|
|
100
|
+
* <button (click)="hasChild = !hasChild">
|
|
101
|
+
* {{hasChild ? 'Destroy' : 'Create'}} MyComponent
|
|
102
|
+
* </button>
|
|
103
|
+
* <my-cmp *ngIf="hasChild"></my-cmp>`,
|
|
104
|
+
* directives: [MyComponent, NgIf]
|
|
105
|
+
* })
|
|
106
|
+
* export class App {
|
|
107
|
+
* hasChild = true;
|
|
108
|
+
* }
|
|
109
|
+
*
|
|
110
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
111
|
+
* ```
|
|
112
|
+
* @stable
|
|
113
|
+
*/
|
|
114
|
+
export class OnInit {
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Implement this interface to supplement the default change detection algorithm in your directive.
|
|
118
|
+
*
|
|
119
|
+
* `ngDoCheck` gets called to check the changes in the directives in addition to the default
|
|
120
|
+
* algorithm.
|
|
121
|
+
*
|
|
122
|
+
* The default change detection algorithm looks for differences by comparing bound-property values
|
|
123
|
+
* by reference across change detection runs.
|
|
124
|
+
*
|
|
125
|
+
* Note that a directive typically should not use both `DoCheck` and {@link OnChanges} to respond to
|
|
126
|
+
* changes on the same input. `ngOnChanges` will continue to be called when the default change
|
|
127
|
+
* detector
|
|
128
|
+
* detects changes, so it is usually unnecessary to respond to changes on the same input in both
|
|
129
|
+
* hooks.
|
|
130
|
+
* Reaction to the changes have to be handled from within the `ngDoCheck` callback.
|
|
131
|
+
*
|
|
132
|
+
* You can use {@link KeyValueDiffers} and {@link IterableDiffers} to help add your custom check
|
|
133
|
+
* mechanisms.
|
|
134
|
+
*
|
|
135
|
+
* ### Example ([live demo](http://plnkr.co/edit/QpnIlF0CR2i5bcYbHEUJ?p=preview))
|
|
136
|
+
*
|
|
137
|
+
* In the following example `ngDoCheck` uses an {@link IterableDiffers} to detect the updates to the
|
|
138
|
+
* array `list`:
|
|
139
|
+
*
|
|
140
|
+
* ```typescript
|
|
141
|
+
* @Component({
|
|
142
|
+
* selector: 'custom-check',
|
|
143
|
+
* template: `
|
|
144
|
+
* <p>Changes:</p>
|
|
145
|
+
* <ul>
|
|
146
|
+
* <li *ngFor="let line of logs">{{line}}</li>
|
|
147
|
+
* </ul>`,
|
|
148
|
+
* directives: [NgFor]
|
|
149
|
+
* })
|
|
150
|
+
* class CustomCheckComponent implements DoCheck {
|
|
151
|
+
* @Input() list: any[];
|
|
152
|
+
* differ: any;
|
|
153
|
+
* logs = [];
|
|
154
|
+
*
|
|
155
|
+
* constructor(differs: IterableDiffers) {
|
|
156
|
+
* this.differ = differs.find([]).create(null);
|
|
157
|
+
* }
|
|
158
|
+
*
|
|
159
|
+
* ngDoCheck() {
|
|
160
|
+
* var changes = this.differ.diff(this.list);
|
|
161
|
+
*
|
|
162
|
+
* if (changes) {
|
|
163
|
+
* changes.forEachAddedItem(r => this.logs.push('added ' + r.item));
|
|
164
|
+
* changes.forEachRemovedItem(r => this.logs.push('removed ' + r.item))
|
|
165
|
+
* }
|
|
166
|
+
* }
|
|
167
|
+
* }
|
|
168
|
+
*
|
|
169
|
+
* @Component({
|
|
170
|
+
* selector: 'app',
|
|
171
|
+
* template: `
|
|
172
|
+
* <button (click)="list.push(list.length)">Push</button>
|
|
173
|
+
* <button (click)="list.pop()">Pop</button>
|
|
174
|
+
* <custom-check [list]="list"></custom-check>`,
|
|
175
|
+
* directives: [CustomCheckComponent]
|
|
176
|
+
* })
|
|
177
|
+
* export class App {
|
|
178
|
+
* list = [];
|
|
179
|
+
* }
|
|
180
|
+
* ```
|
|
181
|
+
* @stable
|
|
182
|
+
*/
|
|
183
|
+
export class DoCheck {
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Implement this interface to get notified when your directive is destroyed.
|
|
187
|
+
*
|
|
188
|
+
* `ngOnDestroy` callback is typically used for any custom cleanup that needs to occur when the
|
|
189
|
+
* instance is destroyed
|
|
190
|
+
*
|
|
191
|
+
* ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview))
|
|
192
|
+
*
|
|
193
|
+
* ```typesript
|
|
194
|
+
* @Component({
|
|
195
|
+
* selector: 'my-cmp',
|
|
196
|
+
* template: `<p>my-component</p>`
|
|
197
|
+
* })
|
|
198
|
+
* class MyComponent implements OnInit, OnDestroy {
|
|
199
|
+
* ngOnInit() {
|
|
200
|
+
* console.log('ngOnInit');
|
|
201
|
+
* }
|
|
202
|
+
*
|
|
203
|
+
* ngOnDestroy() {
|
|
204
|
+
* console.log('ngOnDestroy');
|
|
205
|
+
* }
|
|
206
|
+
* }
|
|
207
|
+
*
|
|
208
|
+
* @Component({
|
|
209
|
+
* selector: 'app',
|
|
210
|
+
* template: `
|
|
211
|
+
* <button (click)="hasChild = !hasChild">
|
|
212
|
+
* {{hasChild ? 'Destroy' : 'Create'}} MyComponent
|
|
213
|
+
* </button>
|
|
214
|
+
* <my-cmp *ngIf="hasChild"></my-cmp>`,
|
|
215
|
+
* directives: [MyComponent, NgIf]
|
|
216
|
+
* })
|
|
217
|
+
* export class App {
|
|
218
|
+
* hasChild = true;
|
|
219
|
+
* }
|
|
220
|
+
*
|
|
221
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
222
|
+
* ```
|
|
223
|
+
*
|
|
224
|
+
*
|
|
225
|
+
* To create a stateful Pipe, you should implement this interface and set the `pure`
|
|
226
|
+
* parameter to `false` in the {@link PipeMetadata}.
|
|
227
|
+
*
|
|
228
|
+
* A stateful pipe may produce different output, given the same input. It is
|
|
229
|
+
* likely that a stateful pipe may contain state that should be cleaned up when
|
|
230
|
+
* a binding is destroyed. For example, a subscription to a stream of data may need to
|
|
231
|
+
* be disposed, or an interval may need to be cleared.
|
|
232
|
+
*
|
|
233
|
+
* ### Example ([live demo](http://plnkr.co/edit/i8pm5brO4sPaLxBx56MR?p=preview))
|
|
234
|
+
*
|
|
235
|
+
* In this example, a pipe is created to countdown its input value, updating it every
|
|
236
|
+
* 50ms. Because it maintains an internal interval, it automatically clears
|
|
237
|
+
* the interval when the binding is destroyed or the countdown completes.
|
|
238
|
+
*
|
|
239
|
+
* ```
|
|
240
|
+
* import {OnDestroy, Pipe, PipeTransform} from '@angular/core'
|
|
241
|
+
* @Pipe({name: 'countdown', pure: false})
|
|
242
|
+
* class CountDown implements PipeTransform, OnDestroy {
|
|
243
|
+
* remainingTime:Number;
|
|
244
|
+
* interval:SetInterval;
|
|
245
|
+
* ngOnDestroy() {
|
|
246
|
+
* if (this.interval) {
|
|
247
|
+
* clearInterval(this.interval);
|
|
248
|
+
* }
|
|
249
|
+
* }
|
|
250
|
+
* transform(value: any, args: any[] = []) {
|
|
251
|
+
* if (!parseInt(value, 10)) return null;
|
|
252
|
+
* if (typeof this.remainingTime !== 'number') {
|
|
253
|
+
* this.remainingTime = parseInt(value, 10);
|
|
254
|
+
* }
|
|
255
|
+
* if (!this.interval) {
|
|
256
|
+
* this.interval = setInterval(() => {
|
|
257
|
+
* this.remainingTime-=50;
|
|
258
|
+
* if (this.remainingTime <= 0) {
|
|
259
|
+
* this.remainingTime = 0;
|
|
260
|
+
* clearInterval(this.interval);
|
|
261
|
+
* delete this.interval;
|
|
262
|
+
* }
|
|
263
|
+
* }, 50);
|
|
264
|
+
* }
|
|
265
|
+
* return this.remainingTime;
|
|
266
|
+
* }
|
|
267
|
+
* }
|
|
268
|
+
* ```
|
|
269
|
+
*
|
|
270
|
+
* Invoking `{{ 10000 | countdown }}` would cause the value to be decremented by 50,
|
|
271
|
+
* every 50ms, until it reaches 0.
|
|
272
|
+
*
|
|
273
|
+
* @stable
|
|
274
|
+
*/
|
|
275
|
+
export class OnDestroy {
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Implement this interface to get notified when your directive's content has been fully
|
|
279
|
+
* initialized.
|
|
280
|
+
*
|
|
281
|
+
* ### Example ([live demo](http://plnkr.co/edit/plamXUpsLQbIXpViZhUO?p=preview))
|
|
282
|
+
*
|
|
283
|
+
* ```typescript
|
|
284
|
+
* @Component({
|
|
285
|
+
* selector: 'child-cmp',
|
|
286
|
+
* template: `{{where}} child`
|
|
287
|
+
* })
|
|
288
|
+
* class ChildComponent {
|
|
289
|
+
* @Input() where: string;
|
|
290
|
+
* }
|
|
291
|
+
*
|
|
292
|
+
* @Component({
|
|
293
|
+
* selector: 'parent-cmp',
|
|
294
|
+
* template: `<ng-content></ng-content>`
|
|
295
|
+
* })
|
|
296
|
+
* class ParentComponent implements AfterContentInit {
|
|
297
|
+
* @ContentChild(ChildComponent) contentChild: ChildComponent;
|
|
298
|
+
*
|
|
299
|
+
* constructor() {
|
|
300
|
+
* // contentChild is not initialized yet
|
|
301
|
+
* console.log(this.getMessage(this.contentChild));
|
|
302
|
+
* }
|
|
303
|
+
*
|
|
304
|
+
* ngAfterContentInit() {
|
|
305
|
+
* // contentChild is updated after the content has been checked
|
|
306
|
+
* console.log('AfterContentInit: ' + this.getMessage(this.contentChild));
|
|
307
|
+
* }
|
|
308
|
+
*
|
|
309
|
+
* private getMessage(cmp: ChildComponent): string {
|
|
310
|
+
* return cmp ? cmp.where + ' child' : 'no child';
|
|
311
|
+
* }
|
|
312
|
+
* }
|
|
313
|
+
*
|
|
314
|
+
* @Component({
|
|
315
|
+
* selector: 'app',
|
|
316
|
+
* template: `
|
|
317
|
+
* <parent-cmp>
|
|
318
|
+
* <child-cmp where="content"></child-cmp>
|
|
319
|
+
* </parent-cmp>`,
|
|
320
|
+
* directives: [ParentComponent, ChildComponent]
|
|
321
|
+
* })
|
|
322
|
+
* export class App {
|
|
323
|
+
* }
|
|
324
|
+
*
|
|
325
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
326
|
+
* ```
|
|
327
|
+
* @stable
|
|
328
|
+
*/
|
|
329
|
+
export class AfterContentInit {
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Implement this interface to get notified after every check of your directive's content.
|
|
333
|
+
*
|
|
334
|
+
* ### Example ([live demo](http://plnkr.co/edit/tGdrytNEKQnecIPkD7NU?p=preview))
|
|
335
|
+
*
|
|
336
|
+
* ```typescript
|
|
337
|
+
* @Component({selector: 'child-cmp', template: `{{where}} child`})
|
|
338
|
+
* class ChildComponent {
|
|
339
|
+
* @Input() where: string;
|
|
340
|
+
* }
|
|
341
|
+
*
|
|
342
|
+
* @Component({selector: 'parent-cmp', template: `<ng-content></ng-content>`})
|
|
343
|
+
* class ParentComponent implements AfterContentChecked {
|
|
344
|
+
* @ContentChild(ChildComponent) contentChild: ChildComponent;
|
|
345
|
+
*
|
|
346
|
+
* constructor() {
|
|
347
|
+
* // contentChild is not initialized yet
|
|
348
|
+
* console.log(this.getMessage(this.contentChild));
|
|
349
|
+
* }
|
|
350
|
+
*
|
|
351
|
+
* ngAfterContentChecked() {
|
|
352
|
+
* // contentChild is updated after the content has been checked
|
|
353
|
+
* console.log('AfterContentChecked: ' + this.getMessage(this.contentChild));
|
|
354
|
+
* }
|
|
355
|
+
*
|
|
356
|
+
* private getMessage(cmp: ChildComponent): string {
|
|
357
|
+
* return cmp ? cmp.where + ' child' : 'no child';
|
|
358
|
+
* }
|
|
359
|
+
* }
|
|
360
|
+
*
|
|
361
|
+
* @Component({
|
|
362
|
+
* selector: 'app',
|
|
363
|
+
* template: `
|
|
364
|
+
* <parent-cmp>
|
|
365
|
+
* <button (click)="hasContent = !hasContent">Toggle content child</button>
|
|
366
|
+
* <child-cmp *ngIf="hasContent" where="content"></child-cmp>
|
|
367
|
+
* </parent-cmp>`,
|
|
368
|
+
* directives: [NgIf, ParentComponent, ChildComponent]
|
|
369
|
+
* })
|
|
370
|
+
* export class App {
|
|
371
|
+
* hasContent = true;
|
|
372
|
+
* }
|
|
373
|
+
*
|
|
374
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
375
|
+
* ```
|
|
376
|
+
* @stable
|
|
377
|
+
*/
|
|
378
|
+
export class AfterContentChecked {
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Implement this interface to get notified when your component's view has been fully initialized.
|
|
382
|
+
*
|
|
383
|
+
* ### Example ([live demo](http://plnkr.co/edit/LhTKVMEM0fkJgyp4CI1W?p=preview))
|
|
384
|
+
*
|
|
385
|
+
* ```typescript
|
|
386
|
+
* @Component({selector: 'child-cmp', template: `{{where}} child`})
|
|
387
|
+
* class ChildComponent {
|
|
388
|
+
* @Input() where: string;
|
|
389
|
+
* }
|
|
390
|
+
*
|
|
391
|
+
* @Component({
|
|
392
|
+
* selector: 'parent-cmp',
|
|
393
|
+
* template: `<child-cmp where="view"></child-cmp>`,
|
|
394
|
+
* directives: [ChildComponent]
|
|
395
|
+
* })
|
|
396
|
+
* class ParentComponent implements AfterViewInit {
|
|
397
|
+
* @ViewChild(ChildComponent) viewChild: ChildComponent;
|
|
398
|
+
*
|
|
399
|
+
* constructor() {
|
|
400
|
+
* // viewChild is not initialized yet
|
|
401
|
+
* console.log(this.getMessage(this.viewChild));
|
|
402
|
+
* }
|
|
403
|
+
*
|
|
404
|
+
* ngAfterViewInit() {
|
|
405
|
+
* // viewChild is updated after the view has been initialized
|
|
406
|
+
* console.log('ngAfterViewInit: ' + this.getMessage(this.viewChild));
|
|
407
|
+
* }
|
|
408
|
+
*
|
|
409
|
+
* private getMessage(cmp: ChildComponent): string {
|
|
410
|
+
* return cmp ? cmp.where + ' child' : 'no child';
|
|
411
|
+
* }
|
|
412
|
+
* }
|
|
413
|
+
*
|
|
414
|
+
* @Component({
|
|
415
|
+
* selector: 'app',
|
|
416
|
+
* template: `<parent-cmp></parent-cmp>`,
|
|
417
|
+
* directives: [ParentComponent]
|
|
418
|
+
* })
|
|
419
|
+
* export class App {
|
|
420
|
+
* }
|
|
421
|
+
*
|
|
422
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
423
|
+
* ```
|
|
424
|
+
* @stable
|
|
425
|
+
*/
|
|
426
|
+
export class AfterViewInit {
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Implement this interface to get notified after every check of your component's view.
|
|
430
|
+
*
|
|
431
|
+
* ### Example ([live demo](http://plnkr.co/edit/0qDGHcPQkc25CXhTNzKU?p=preview))
|
|
432
|
+
*
|
|
433
|
+
* ```typescript
|
|
434
|
+
* @Component({selector: 'child-cmp', template: `{{where}} child`})
|
|
435
|
+
* class ChildComponent {
|
|
436
|
+
* @Input() where: string;
|
|
437
|
+
* }
|
|
438
|
+
*
|
|
439
|
+
* @Component({
|
|
440
|
+
* selector: 'parent-cmp',
|
|
441
|
+
* template: `
|
|
442
|
+
* <button (click)="showView = !showView">Toggle view child</button>
|
|
443
|
+
* <child-cmp *ngIf="showView" where="view"></child-cmp>`,
|
|
444
|
+
* directives: [NgIf, ChildComponent]
|
|
445
|
+
* })
|
|
446
|
+
* class ParentComponent implements AfterViewChecked {
|
|
447
|
+
* @ViewChild(ChildComponent) viewChild: ChildComponent;
|
|
448
|
+
* showView = true;
|
|
449
|
+
*
|
|
450
|
+
* constructor() {
|
|
451
|
+
* // viewChild is not initialized yet
|
|
452
|
+
* console.log(this.getMessage(this.viewChild));
|
|
453
|
+
* }
|
|
454
|
+
*
|
|
455
|
+
* ngAfterViewChecked() {
|
|
456
|
+
* // viewChild is updated after the view has been checked
|
|
457
|
+
* console.log('AfterViewChecked: ' + this.getMessage(this.viewChild));
|
|
458
|
+
* }
|
|
459
|
+
*
|
|
460
|
+
* private getMessage(cmp: ChildComponent): string {
|
|
461
|
+
* return cmp ? cmp.where + ' child' : 'no child';
|
|
462
|
+
* }
|
|
463
|
+
* }
|
|
464
|
+
*
|
|
465
|
+
* @Component({
|
|
466
|
+
* selector: 'app',
|
|
467
|
+
* template: `<parent-cmp></parent-cmp>`,
|
|
468
|
+
* directives: [ParentComponent]
|
|
469
|
+
* })
|
|
470
|
+
* export class App {
|
|
471
|
+
* }
|
|
472
|
+
*
|
|
473
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
474
|
+
* ```
|
|
475
|
+
* @stable
|
|
476
|
+
*/
|
|
477
|
+
export class AfterViewChecked {
|
|
478
|
+
}
|
|
25
479
|
//# sourceMappingURL=lifecycle_hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle_hooks.js","sourceRoot":"/Users/iminar/Dev/angular/modules/@angular/core/","sources":["src/metadata/lifecycle_hooks.ts"],"names":[],"mappings":"AAMA,WAAY,cASX;AATD,WAAY,cAAc;IACxB,uDAAM,CAAA;IACN,6DAAS,CAAA;IACT,yDAAO,CAAA;IACP,6DAAS,CAAA;IACT,2EAAgB,CAAA;IAChB,iFAAmB,CAAA;IACnB,qEAAa,CAAA;IACb,2EAAgB,CAAA;AAClB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB;AAED;;GAEG;AACH,OAAO,IAAI,sBAAsB,GAAG;IAClC,cAAc,CAAC,MAAM;IACrB,cAAc,CAAC,SAAS;IACxB,cAAc,CAAC,OAAO;IACtB,cAAc,CAAC,SAAS;IACxB,cAAc,CAAC,gBAAgB;IAC/B,cAAc,CAAC,mBAAmB;IAClC,cAAc,CAAC,aAAa;IAC5B,cAAc,CAAC,gBAAgB;CAChC,CAAC"}
|
|
1
|
+
{"version":3,"file":"lifecycle_hooks.js","sourceRoot":"","sources":["../../../../../../modules/@angular/core/src/metadata/lifecycle_hooks.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,WAAY,cASX;AATD,WAAY,cAAc;IACxB,uDAAM,CAAA;IACN,6DAAS,CAAA;IACT,yDAAO,CAAA;IACP,6DAAS,CAAA;IACT,2EAAgB,CAAA;IAChB,iFAAmB,CAAA;IACnB,qEAAa,CAAA;IACb,2EAAgB,CAAA;AAClB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB;AASD,OAAO,IAAI,sBAAsB,GAAG;IAClC,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,SAAS;IACjG,cAAc,CAAC,gBAAgB,EAAE,cAAc,CAAC,mBAAmB,EAAE,cAAc,CAAC,aAAa;IACjG,cAAc,CAAC,gBAAgB;CAChC,CAAC;AAEF;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH;AAEA,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH;AAA2E,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH;AAA6E,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH;AAAiF,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH;AAA+F,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;AAEA,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH;AAAyF,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;AAA+F,CAAC;AAAA","sourcesContent":["import {SimpleChange} from '../change_detection/change_detection_util';\n\n/**\n * @stable\n */\nexport enum LifecycleHooks {\n OnInit,\n OnDestroy,\n DoCheck,\n OnChanges,\n AfterContentInit,\n AfterContentChecked,\n AfterViewInit,\n AfterViewChecked\n}\n\n/**\n * A `changes` object whose keys are property names and\n * values are instances of {@link SimpleChange}. See {@link OnChanges}\n * @stable\n */\nexport interface SimpleChanges { [propName: string]: SimpleChange; }\n\nexport var LIFECYCLE_HOOKS_VALUES = [\n LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges,\n LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit,\n LifecycleHooks.AfterViewChecked\n];\n\n/**\n * Lifecycle hooks are guaranteed to be called in the following order:\n * - `OnChanges` (if any bindings have changed),\n * - `OnInit` (after the first check only),\n * - `DoCheck`,\n * - `AfterContentInit`,\n * - `AfterContentChecked`,\n * - `AfterViewInit`,\n * - `AfterViewChecked`,\n * - `OnDestroy` (at the very end before destruction)\n */\n\n/**\n * Implement this interface to get notified when any data-bound property of your directive changes.\n *\n * `ngOnChanges` is called right after the data-bound properties have been checked and before view\n * and content children are checked if at least one of them has changed.\n *\n * The `changes` parameter contains an entry for each of the changed data-bound property. The key is\n * the property name and the value is an instance of {@link SimpleChange}.\n *\n * ### Example ([live example](http://plnkr.co/edit/AHrB6opLqHDBPkt4KpdT?p=preview)):\n *\n * ```typescript\n * @Component({\n * selector: 'my-cmp',\n * template: `<p>myProp = {{myProp}}</p>`\n * })\n * class MyComponent implements OnChanges {\n * @Input() myProp: any;\n *\n * ngOnChanges(changes: SimpleChanges) {\n * console.log('ngOnChanges - myProp = ' + changes['myProp'].currentValue);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <button (click)=\"value = value + 1\">Change MyComponent</button>\n * <my-cmp [my-prop]=\"value\"></my-cmp>`,\n * directives: [MyComponent]\n * })\n * export class App {\n * value = 0;\n * }\n *\n * bootstrap(App).catch(err => console.error(err));\n * ```\n * @stable\n */\nexport abstract class OnChanges {\n abstract ngOnChanges(changes: SimpleChanges): any /** TODO #9100 */;\n}\n\n/**\n * Implement this interface to execute custom initialization logic after your directive's\n * data-bound properties have been initialized.\n *\n * `ngOnInit` is called right after the directive's data-bound properties have been checked for the\n * first time, and before any of its children have been checked. It is invoked only once when the\n * directive is instantiated.\n *\n * ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview))\n *\n * ```typescript\n * @Component({\n * selector: 'my-cmp',\n * template: `<p>my-component</p>`\n * })\n * class MyComponent implements OnInit, OnDestroy {\n * ngOnInit() {\n * console.log('ngOnInit');\n * }\n *\n * ngOnDestroy() {\n * console.log('ngOnDestroy');\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <button (click)=\"hasChild = !hasChild\">\n * {{hasChild ? 'Destroy' : 'Create'}} MyComponent\n * </button>\n * <my-cmp *ngIf=\"hasChild\"></my-cmp>`,\n * directives: [MyComponent, NgIf]\n * })\n * export class App {\n * hasChild = true;\n * }\n *\n * bootstrap(App).catch(err => console.error(err));\n * ```\n * @stable\n */\nexport abstract class OnInit { abstract ngOnInit(): any /** TODO #9100 */; }\n\n/**\n * Implement this interface to supplement the default change detection algorithm in your directive.\n *\n * `ngDoCheck` gets called to check the changes in the directives in addition to the default\n * algorithm.\n *\n * The default change detection algorithm looks for differences by comparing bound-property values\n * by reference across change detection runs.\n *\n * Note that a directive typically should not use both `DoCheck` and {@link OnChanges} to respond to\n * changes on the same input. `ngOnChanges` will continue to be called when the default change\n * detector\n * detects changes, so it is usually unnecessary to respond to changes on the same input in both\n * hooks.\n * Reaction to the changes have to be handled from within the `ngDoCheck` callback.\n *\n * You can use {@link KeyValueDiffers} and {@link IterableDiffers} to help add your custom check\n * mechanisms.\n *\n * ### Example ([live demo](http://plnkr.co/edit/QpnIlF0CR2i5bcYbHEUJ?p=preview))\n *\n * In the following example `ngDoCheck` uses an {@link IterableDiffers} to detect the updates to the\n * array `list`:\n *\n * ```typescript\n * @Component({\n * selector: 'custom-check',\n * template: `\n * <p>Changes:</p>\n * <ul>\n * <li *ngFor=\"let line of logs\">{{line}}</li>\n * </ul>`,\n * directives: [NgFor]\n * })\n * class CustomCheckComponent implements DoCheck {\n * @Input() list: any[];\n * differ: any;\n * logs = [];\n *\n * constructor(differs: IterableDiffers) {\n * this.differ = differs.find([]).create(null);\n * }\n *\n * ngDoCheck() {\n * var changes = this.differ.diff(this.list);\n *\n * if (changes) {\n * changes.forEachAddedItem(r => this.logs.push('added ' + r.item));\n * changes.forEachRemovedItem(r => this.logs.push('removed ' + r.item))\n * }\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <button (click)=\"list.push(list.length)\">Push</button>\n * <button (click)=\"list.pop()\">Pop</button>\n * <custom-check [list]=\"list\"></custom-check>`,\n * directives: [CustomCheckComponent]\n * })\n * export class App {\n * list = [];\n * }\n * ```\n * @stable\n */\nexport abstract class DoCheck { abstract ngDoCheck(): any /** TODO #9100 */; }\n\n/**\n * Implement this interface to get notified when your directive is destroyed.\n *\n * `ngOnDestroy` callback is typically used for any custom cleanup that needs to occur when the\n * instance is destroyed\n *\n * ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview))\n *\n * ```typesript\n * @Component({\n * selector: 'my-cmp',\n * template: `<p>my-component</p>`\n * })\n * class MyComponent implements OnInit, OnDestroy {\n * ngOnInit() {\n * console.log('ngOnInit');\n * }\n *\n * ngOnDestroy() {\n * console.log('ngOnDestroy');\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <button (click)=\"hasChild = !hasChild\">\n * {{hasChild ? 'Destroy' : 'Create'}} MyComponent\n * </button>\n * <my-cmp *ngIf=\"hasChild\"></my-cmp>`,\n * directives: [MyComponent, NgIf]\n * })\n * export class App {\n * hasChild = true;\n * }\n *\n * bootstrap(App).catch(err => console.error(err));\n * ```\n *\n *\n * To create a stateful Pipe, you should implement this interface and set the `pure`\n * parameter to `false` in the {@link PipeMetadata}.\n *\n * A stateful pipe may produce different output, given the same input. It is\n * likely that a stateful pipe may contain state that should be cleaned up when\n * a binding is destroyed. For example, a subscription to a stream of data may need to\n * be disposed, or an interval may need to be cleared.\n *\n * ### Example ([live demo](http://plnkr.co/edit/i8pm5brO4sPaLxBx56MR?p=preview))\n *\n * In this example, a pipe is created to countdown its input value, updating it every\n * 50ms. Because it maintains an internal interval, it automatically clears\n * the interval when the binding is destroyed or the countdown completes.\n *\n * ```\n * import {OnDestroy, Pipe, PipeTransform} from '@angular/core'\n * @Pipe({name: 'countdown', pure: false})\n * class CountDown implements PipeTransform, OnDestroy {\n * remainingTime:Number;\n * interval:SetInterval;\n * ngOnDestroy() {\n * if (this.interval) {\n * clearInterval(this.interval);\n * }\n * }\n * transform(value: any, args: any[] = []) {\n * if (!parseInt(value, 10)) return null;\n * if (typeof this.remainingTime !== 'number') {\n * this.remainingTime = parseInt(value, 10);\n * }\n * if (!this.interval) {\n * this.interval = setInterval(() => {\n * this.remainingTime-=50;\n * if (this.remainingTime <= 0) {\n * this.remainingTime = 0;\n * clearInterval(this.interval);\n * delete this.interval;\n * }\n * }, 50);\n * }\n * return this.remainingTime;\n * }\n * }\n * ```\n *\n * Invoking `{{ 10000 | countdown }}` would cause the value to be decremented by 50,\n * every 50ms, until it reaches 0.\n *\n * @stable\n */\nexport abstract class OnDestroy { abstract ngOnDestroy(): any /** TODO #9100 */; }\n\n/**\n * Implement this interface to get notified when your directive's content has been fully\n * initialized.\n *\n * ### Example ([live demo](http://plnkr.co/edit/plamXUpsLQbIXpViZhUO?p=preview))\n *\n * ```typescript\n * @Component({\n * selector: 'child-cmp',\n * template: `{{where}} child`\n * })\n * class ChildComponent {\n * @Input() where: string;\n * }\n *\n * @Component({\n * selector: 'parent-cmp',\n * template: `<ng-content></ng-content>`\n * })\n * class ParentComponent implements AfterContentInit {\n * @ContentChild(ChildComponent) contentChild: ChildComponent;\n *\n * constructor() {\n * // contentChild is not initialized yet\n * console.log(this.getMessage(this.contentChild));\n * }\n *\n * ngAfterContentInit() {\n * // contentChild is updated after the content has been checked\n * console.log('AfterContentInit: ' + this.getMessage(this.contentChild));\n * }\n *\n * private getMessage(cmp: ChildComponent): string {\n * return cmp ? cmp.where + ' child' : 'no child';\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <parent-cmp>\n * <child-cmp where=\"content\"></child-cmp>\n * </parent-cmp>`,\n * directives: [ParentComponent, ChildComponent]\n * })\n * export class App {\n * }\n *\n * bootstrap(App).catch(err => console.error(err));\n * ```\n * @stable\n */\nexport abstract class AfterContentInit { abstract ngAfterContentInit(): any /** TODO #9100 */; }\n\n/**\n * Implement this interface to get notified after every check of your directive's content.\n *\n * ### Example ([live demo](http://plnkr.co/edit/tGdrytNEKQnecIPkD7NU?p=preview))\n *\n * ```typescript\n * @Component({selector: 'child-cmp', template: `{{where}} child`})\n * class ChildComponent {\n * @Input() where: string;\n * }\n *\n * @Component({selector: 'parent-cmp', template: `<ng-content></ng-content>`})\n * class ParentComponent implements AfterContentChecked {\n * @ContentChild(ChildComponent) contentChild: ChildComponent;\n *\n * constructor() {\n * // contentChild is not initialized yet\n * console.log(this.getMessage(this.contentChild));\n * }\n *\n * ngAfterContentChecked() {\n * // contentChild is updated after the content has been checked\n * console.log('AfterContentChecked: ' + this.getMessage(this.contentChild));\n * }\n *\n * private getMessage(cmp: ChildComponent): string {\n * return cmp ? cmp.where + ' child' : 'no child';\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <parent-cmp>\n * <button (click)=\"hasContent = !hasContent\">Toggle content child</button>\n * <child-cmp *ngIf=\"hasContent\" where=\"content\"></child-cmp>\n * </parent-cmp>`,\n * directives: [NgIf, ParentComponent, ChildComponent]\n * })\n * export class App {\n * hasContent = true;\n * }\n *\n * bootstrap(App).catch(err => console.error(err));\n * ```\n * @stable\n */\nexport abstract class AfterContentChecked {\n abstract ngAfterContentChecked(): any /** TODO #9100 */;\n}\n\n/**\n * Implement this interface to get notified when your component's view has been fully initialized.\n *\n * ### Example ([live demo](http://plnkr.co/edit/LhTKVMEM0fkJgyp4CI1W?p=preview))\n *\n * ```typescript\n * @Component({selector: 'child-cmp', template: `{{where}} child`})\n * class ChildComponent {\n * @Input() where: string;\n * }\n *\n * @Component({\n * selector: 'parent-cmp',\n * template: `<child-cmp where=\"view\"></child-cmp>`,\n * directives: [ChildComponent]\n * })\n * class ParentComponent implements AfterViewInit {\n * @ViewChild(ChildComponent) viewChild: ChildComponent;\n *\n * constructor() {\n * // viewChild is not initialized yet\n * console.log(this.getMessage(this.viewChild));\n * }\n *\n * ngAfterViewInit() {\n * // viewChild is updated after the view has been initialized\n * console.log('ngAfterViewInit: ' + this.getMessage(this.viewChild));\n * }\n *\n * private getMessage(cmp: ChildComponent): string {\n * return cmp ? cmp.where + ' child' : 'no child';\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<parent-cmp></parent-cmp>`,\n * directives: [ParentComponent]\n * })\n * export class App {\n * }\n *\n * bootstrap(App).catch(err => console.error(err));\n * ```\n * @stable\n */\nexport abstract class AfterViewInit { abstract ngAfterViewInit(): any /** TODO #9100 */; }\n\n/**\n * Implement this interface to get notified after every check of your component's view.\n *\n * ### Example ([live demo](http://plnkr.co/edit/0qDGHcPQkc25CXhTNzKU?p=preview))\n *\n * ```typescript\n * @Component({selector: 'child-cmp', template: `{{where}} child`})\n * class ChildComponent {\n * @Input() where: string;\n * }\n *\n * @Component({\n * selector: 'parent-cmp',\n * template: `\n * <button (click)=\"showView = !showView\">Toggle view child</button>\n * <child-cmp *ngIf=\"showView\" where=\"view\"></child-cmp>`,\n * directives: [NgIf, ChildComponent]\n * })\n * class ParentComponent implements AfterViewChecked {\n * @ViewChild(ChildComponent) viewChild: ChildComponent;\n * showView = true;\n *\n * constructor() {\n * // viewChild is not initialized yet\n * console.log(this.getMessage(this.viewChild));\n * }\n *\n * ngAfterViewChecked() {\n * // viewChild is updated after the view has been checked\n * console.log('AfterViewChecked: ' + this.getMessage(this.viewChild));\n * }\n *\n * private getMessage(cmp: ChildComponent): string {\n * return cmp ? cmp.where + ' child' : 'no child';\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<parent-cmp></parent-cmp>`,\n * directives: [ParentComponent]\n * })\n * export class App {\n * }\n *\n * bootstrap(App).catch(err => console.error(err));\n * ```\n * @stable\n */\nexport abstract class AfterViewChecked { abstract ngAfterViewChecked(): any /** TODO #9100 */; }\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","metadata":{"LIFECYCLE_HOOKS_VALUES":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"OnInit"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"OnDestroy"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"DoCheck"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"OnChanges"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"AfterContentInit"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"AfterContentChecked"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"AfterViewInit"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"AfterViewChecked"}]}}
|
|
1
|
+
{"__symbolic":"module","version":1,"metadata":{"LIFECYCLE_HOOKS_VALUES":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"OnInit"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"OnDestroy"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"DoCheck"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"OnChanges"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"AfterContentInit"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"AfterContentChecked"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"AfterViewInit"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"LifecycleHooks"},"member":"AfterViewChecked"}]}}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnimationEntryMetadata } from '../animation/metadata';
|
|
2
|
+
import { Type } from '../facade/lang';
|
|
2
3
|
/**
|
|
3
4
|
* Defines template and style encapsulation options available for Component's {@link View}.
|
|
4
5
|
*
|
|
5
6
|
* See {@link ViewMetadata#encapsulation}.
|
|
7
|
+
* @stable
|
|
6
8
|
*/
|
|
7
9
|
export declare enum ViewEncapsulation {
|
|
8
10
|
/**
|
|
@@ -111,7 +113,8 @@ export declare class ViewMetadata {
|
|
|
111
113
|
* otherwise {@link ViewEncapsulation#None `ViewEncapsulation.None`}.
|
|
112
114
|
*/
|
|
113
115
|
encapsulation: ViewEncapsulation;
|
|
114
|
-
|
|
116
|
+
animations: AnimationEntryMetadata[];
|
|
117
|
+
constructor({templateUrl, template, directives, pipes, encapsulation, styles, styleUrls, animations}?: {
|
|
115
118
|
templateUrl?: string;
|
|
116
119
|
template?: string;
|
|
117
120
|
directives?: Array<Type | any[]>;
|
|
@@ -119,5 +122,6 @@ export declare class ViewMetadata {
|
|
|
119
122
|
encapsulation?: ViewEncapsulation;
|
|
120
123
|
styles?: string[];
|
|
121
124
|
styleUrls?: string[];
|
|
125
|
+
animations?: AnimationEntryMetadata[];
|
|
122
126
|
});
|
|
123
127
|
}
|
package/esm/src/metadata/view.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Defines template and style encapsulation options available for Component's {@link View}.
|
|
3
3
|
*
|
|
4
4
|
* See {@link ViewMetadata#encapsulation}.
|
|
5
|
+
* @stable
|
|
5
6
|
*/
|
|
6
7
|
export var ViewEncapsulation;
|
|
7
8
|
(function (ViewEncapsulation) {
|
|
@@ -58,7 +59,7 @@ export var VIEW_ENCAPSULATION_VALUES = [ViewEncapsulation.Emulated, ViewEncapsul
|
|
|
58
59
|
* @ts2dart_const
|
|
59
60
|
*/
|
|
60
61
|
export class ViewMetadata {
|
|
61
|
-
constructor({ templateUrl, template, directives, pipes, encapsulation, styles, styleUrls } = {}) {
|
|
62
|
+
constructor({ templateUrl, template, directives, pipes, encapsulation, styles, styleUrls, animations } = {}) {
|
|
62
63
|
this.templateUrl = templateUrl;
|
|
63
64
|
this.template = template;
|
|
64
65
|
this.styleUrls = styleUrls;
|
|
@@ -66,6 +67,7 @@ export class ViewMetadata {
|
|
|
66
67
|
this.directives = directives;
|
|
67
68
|
this.pipes = pipes;
|
|
68
69
|
this.encapsulation = encapsulation;
|
|
70
|
+
this.animations = animations;
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
//# sourceMappingURL=view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../../../modules/@angular/core/src/metadata/view.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,WAAY,iBAqBX;AArBD,WAAY,iBAAiB;IAC3B;;;;;;;OAOG;IACH,iEAAQ,CAAA;IACR;;;;;OAKG;IACH,6DAAM,CAAA;IACN;;OAEG;IACH,yDAAI,CAAA;AACN,CAAC,EArBW,iBAAiB,KAAjB,iBAAiB,QAqB5B;AAED,OAAO,IAAI,yBAAyB,GAChC,CAAC,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;AAGnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;IA+DE,YACI,EAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAC,GASpF,EAAE;QACR,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;AACH,CAAC;AAAA","sourcesContent":["import {AnimationEntryMetadata} from '../animation/metadata';\nimport {Type} from '../facade/lang';\n\n\n/**\n * Defines template and style encapsulation options available for Component's {@link View}.\n *\n * See {@link ViewMetadata#encapsulation}.\n * @stable\n */\nexport enum ViewEncapsulation {\n /**\n * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host\n * Element and pre-processing the style rules provided via\n * {@link ViewMetadata#styles} or {@link ViewMetadata#stylesUrls}, and adding the new Host Element\n * attribute to all selectors.\n *\n * This is the default option.\n */\n Emulated,\n /**\n * Use the native encapsulation mechanism of the renderer.\n *\n * For the DOM this means using [Shadow DOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * creating a ShadowRoot for Component's Host Element.\n */\n Native,\n /**\n * Don't provide any template or style encapsulation.\n */\n None\n}\n\nexport var VIEW_ENCAPSULATION_VALUES =\n [ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None];\n\n\n/**\n * Metadata properties available for configuring Views.\n *\n * Each Angular component requires a single `@Component` and at least one `@View` annotation. The\n * `@View` annotation specifies the HTML template to use, and lists the directives that are active\n * within the template.\n *\n * When a component is instantiated, the template is loaded into the component's shadow root, and\n * the expressions and statements in the template are evaluated against the component.\n *\n * For details on the `@Component` annotation, see {@link ComponentMetadata}.\n *\n * ### Example\n *\n * ```\n * @Component({\n * selector: 'greet',\n * template: 'Hello {{name}}!',\n * directives: [GreetUser, Bold]\n * })\n * class Greet {\n * name: string;\n *\n * constructor() {\n * this.name = 'World';\n * }\n * }\n * ```\n * @ts2dart_const\n */\nexport class ViewMetadata {\n /**\n * Specifies a template URL for an Angular component.\n *\n * NOTE: Only one of `templateUrl` or `template` can be defined per View.\n *\n * <!-- TODO: what's the url relative to? -->\n */\n templateUrl: string;\n\n /**\n * Specifies an inline template for an Angular component.\n *\n * NOTE: Only one of `templateUrl` or `template` can be defined per View.\n */\n template: string;\n\n /**\n * Specifies stylesheet URLs for an Angular component.\n *\n * <!-- TODO: what's the url relative to? -->\n */\n styleUrls: string[];\n\n /**\n * Specifies an inline stylesheet for an Angular component.\n */\n styles: string[];\n\n /**\n * Specifies a list of directives that can be used within a template.\n *\n * Directives must be listed explicitly to provide proper component encapsulation.\n *\n * ### Example\n *\n * ```javascript\n * @Component({\n * selector: 'my-component',\n * directives: [NgFor]\n * template: '\n * <ul>\n * <li *ngFor=\"let item of items\">{{item}}</li>\n * </ul>'\n * })\n * class MyComponent {\n * }\n * ```\n */\n directives: Array<Type|any[]>;\n\n pipes: Array<Type|any[]>;\n\n /**\n * Specify how the template and the styles should be encapsulated.\n * The default is {@link ViewEncapsulation#Emulated `ViewEncapsulation.Emulated`} if the view\n * has styles,\n * otherwise {@link ViewEncapsulation#None `ViewEncapsulation.None`}.\n */\n encapsulation: ViewEncapsulation;\n\n animations: AnimationEntryMetadata[];\n\n constructor(\n {templateUrl, template, directives, pipes, encapsulation, styles, styleUrls, animations}: {\n templateUrl?: string,\n template?: string,\n directives?: Array<Type|any[]>,\n pipes?: Array<Type|any[]>,\n encapsulation?: ViewEncapsulation,\n styles?: string[],\n styleUrls?: string[],\n animations?: AnimationEntryMetadata[]\n } = {}) {\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.animations = animations;\n }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","metadata":{"VIEW_ENCAPSULATION_VALUES":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ViewEncapsulation"},"member":"Emulated"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ViewEncapsulation"},"member":"Native"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ViewEncapsulation"},"member":"None"}]}}
|
|
1
|
+
{"__symbolic":"module","version":1,"metadata":{"VIEW_ENCAPSULATION_VALUES":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ViewEncapsulation"},"member":"Emulated"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ViewEncapsulation"},"member":"Native"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ViewEncapsulation"},"member":"None"}]}}
|