@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,4 +1,7 @@
|
|
|
1
1
|
import { SimpleChange } from '../change_detection/change_detection_util';
|
|
2
|
+
/**
|
|
3
|
+
* @stable
|
|
4
|
+
*/
|
|
2
5
|
export declare enum LifecycleHooks {
|
|
3
6
|
OnInit = 0,
|
|
4
7
|
OnDestroy = 1,
|
|
@@ -10,8 +13,13 @@ export declare enum LifecycleHooks {
|
|
|
10
13
|
AfterViewChecked = 7,
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
16
|
+
* A `changes` object whose keys are property names and
|
|
17
|
+
* values are instances of {@link SimpleChange}. See {@link OnChanges}
|
|
18
|
+
* @stable
|
|
14
19
|
*/
|
|
20
|
+
export interface SimpleChanges {
|
|
21
|
+
[propName: string]: SimpleChange;
|
|
22
|
+
}
|
|
15
23
|
export declare var LIFECYCLE_HOOKS_VALUES: LifecycleHooks[];
|
|
16
24
|
/**
|
|
17
25
|
* Lifecycle hooks are guaranteed to be called in the following order:
|
|
@@ -43,7 +51,7 @@ export declare var LIFECYCLE_HOOKS_VALUES: LifecycleHooks[];
|
|
|
43
51
|
* class MyComponent implements OnChanges {
|
|
44
52
|
* @Input() myProp: any;
|
|
45
53
|
*
|
|
46
|
-
* ngOnChanges(changes:
|
|
54
|
+
* ngOnChanges(changes: SimpleChanges) {
|
|
47
55
|
* console.log('ngOnChanges - myProp = ' + changes['myProp'].currentValue);
|
|
48
56
|
* }
|
|
49
57
|
* }
|
|
@@ -61,11 +69,10 @@ export declare var LIFECYCLE_HOOKS_VALUES: LifecycleHooks[];
|
|
|
61
69
|
*
|
|
62
70
|
* bootstrap(App).catch(err => console.error(err));
|
|
63
71
|
* ```
|
|
72
|
+
* @stable
|
|
64
73
|
*/
|
|
65
|
-
export
|
|
66
|
-
ngOnChanges(changes:
|
|
67
|
-
[key: string]: SimpleChange;
|
|
68
|
-
}): any;
|
|
74
|
+
export declare abstract class OnChanges {
|
|
75
|
+
abstract ngOnChanges(changes: SimpleChanges): any;
|
|
69
76
|
}
|
|
70
77
|
/**
|
|
71
78
|
* Implement this interface to execute custom initialization logic after your directive's
|
|
@@ -107,27 +114,29 @@ export interface OnChanges {
|
|
|
107
114
|
*
|
|
108
115
|
* bootstrap(App).catch(err => console.error(err));
|
|
109
116
|
* ```
|
|
117
|
+
* @stable
|
|
110
118
|
*/
|
|
111
|
-
export
|
|
112
|
-
ngOnInit(): any;
|
|
119
|
+
export declare abstract class OnInit {
|
|
120
|
+
abstract ngOnInit(): any;
|
|
113
121
|
}
|
|
114
122
|
/**
|
|
115
|
-
* Implement this interface to
|
|
123
|
+
* Implement this interface to supplement the default change detection algorithm in your directive.
|
|
116
124
|
*
|
|
117
|
-
* `ngDoCheck` gets called to check the changes in the directives
|
|
125
|
+
* `ngDoCheck` gets called to check the changes in the directives in addition to the default
|
|
126
|
+
* algorithm.
|
|
118
127
|
*
|
|
119
128
|
* The default change detection algorithm looks for differences by comparing bound-property values
|
|
120
|
-
* by reference across change detection runs.
|
|
121
|
-
* is disabled and `ngDoCheck` is responsible for checking for changes.
|
|
122
|
-
*
|
|
123
|
-
* Implementing this interface allows improving performance by using insights about the component,
|
|
124
|
-
* its implementation and data types of its properties.
|
|
129
|
+
* by reference across change detection runs.
|
|
125
130
|
*
|
|
126
|
-
* Note that a directive should not
|
|
127
|
-
* `ngOnChanges`
|
|
128
|
-
*
|
|
131
|
+
* Note that a directive typically should not use both `DoCheck` and {@link OnChanges} to respond to
|
|
132
|
+
* changes on the same input. `ngOnChanges` will continue to be called when the default change
|
|
133
|
+
* detector
|
|
134
|
+
* detects changes, so it is usually unnecessary to respond to changes on the same input in both
|
|
135
|
+
* hooks.
|
|
136
|
+
* Reaction to the changes have to be handled from within the `ngDoCheck` callback.
|
|
129
137
|
*
|
|
130
|
-
*
|
|
138
|
+
* You can use {@link KeyValueDiffers} and {@link IterableDiffers} to help add your custom check
|
|
139
|
+
* mechanisms.
|
|
131
140
|
*
|
|
132
141
|
* ### Example ([live demo](http://plnkr.co/edit/QpnIlF0CR2i5bcYbHEUJ?p=preview))
|
|
133
142
|
*
|
|
@@ -175,9 +184,10 @@ export interface OnInit {
|
|
|
175
184
|
* list = [];
|
|
176
185
|
* }
|
|
177
186
|
* ```
|
|
187
|
+
* @stable
|
|
178
188
|
*/
|
|
179
|
-
export
|
|
180
|
-
ngDoCheck(): any;
|
|
189
|
+
export declare abstract class DoCheck {
|
|
190
|
+
abstract ngDoCheck(): any;
|
|
181
191
|
}
|
|
182
192
|
/**
|
|
183
193
|
* Implement this interface to get notified when your directive is destroyed.
|
|
@@ -267,9 +277,10 @@ export interface DoCheck {
|
|
|
267
277
|
* Invoking `{{ 10000 | countdown }}` would cause the value to be decremented by 50,
|
|
268
278
|
* every 50ms, until it reaches 0.
|
|
269
279
|
*
|
|
280
|
+
* @stable
|
|
270
281
|
*/
|
|
271
|
-
export
|
|
272
|
-
ngOnDestroy(): any;
|
|
282
|
+
export declare abstract class OnDestroy {
|
|
283
|
+
abstract ngOnDestroy(): any;
|
|
273
284
|
}
|
|
274
285
|
/**
|
|
275
286
|
* Implement this interface to get notified when your directive's content has been fully
|
|
@@ -321,9 +332,10 @@ export interface OnDestroy {
|
|
|
321
332
|
*
|
|
322
333
|
* bootstrap(App).catch(err => console.error(err));
|
|
323
334
|
* ```
|
|
335
|
+
* @stable
|
|
324
336
|
*/
|
|
325
|
-
export
|
|
326
|
-
ngAfterContentInit(): any;
|
|
337
|
+
export declare abstract class AfterContentInit {
|
|
338
|
+
abstract ngAfterContentInit(): any;
|
|
327
339
|
}
|
|
328
340
|
/**
|
|
329
341
|
* Implement this interface to get notified after every check of your directive's content.
|
|
@@ -370,9 +382,10 @@ export interface AfterContentInit {
|
|
|
370
382
|
*
|
|
371
383
|
* bootstrap(App).catch(err => console.error(err));
|
|
372
384
|
* ```
|
|
385
|
+
* @stable
|
|
373
386
|
*/
|
|
374
|
-
export
|
|
375
|
-
ngAfterContentChecked(): any;
|
|
387
|
+
export declare abstract class AfterContentChecked {
|
|
388
|
+
abstract ngAfterContentChecked(): any;
|
|
376
389
|
}
|
|
377
390
|
/**
|
|
378
391
|
* Implement this interface to get notified when your component's view has been fully initialized.
|
|
@@ -418,9 +431,10 @@ export interface AfterContentChecked {
|
|
|
418
431
|
*
|
|
419
432
|
* bootstrap(App).catch(err => console.error(err));
|
|
420
433
|
* ```
|
|
434
|
+
* @stable
|
|
421
435
|
*/
|
|
422
|
-
export
|
|
423
|
-
ngAfterViewInit(): any;
|
|
436
|
+
export declare abstract class AfterViewInit {
|
|
437
|
+
abstract ngAfterViewInit(): any;
|
|
424
438
|
}
|
|
425
439
|
/**
|
|
426
440
|
* Implement this interface to get notified after every check of your component's view.
|
|
@@ -469,7 +483,8 @@ export interface AfterViewInit {
|
|
|
469
483
|
*
|
|
470
484
|
* bootstrap(App).catch(err => console.error(err));
|
|
471
485
|
* ```
|
|
486
|
+
* @stable
|
|
472
487
|
*/
|
|
473
|
-
export
|
|
474
|
-
ngAfterViewChecked(): any;
|
|
488
|
+
export declare abstract class AfterViewChecked {
|
|
489
|
+
abstract ngAfterViewChecked(): any;
|
|
475
490
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @stable
|
|
4
|
+
*/
|
|
2
5
|
(function (LifecycleHooks) {
|
|
3
6
|
LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit";
|
|
4
7
|
LifecycleHooks[LifecycleHooks["OnDestroy"] = 1] = "OnDestroy";
|
|
@@ -10,17 +13,500 @@
|
|
|
10
13
|
LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked";
|
|
11
14
|
})(exports.LifecycleHooks || (exports.LifecycleHooks = {}));
|
|
12
15
|
var LifecycleHooks = exports.LifecycleHooks;
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
16
|
exports.LIFECYCLE_HOOKS_VALUES = [
|
|
17
|
-
LifecycleHooks.OnInit,
|
|
18
|
-
LifecycleHooks.
|
|
19
|
-
LifecycleHooks.DoCheck,
|
|
20
|
-
LifecycleHooks.OnChanges,
|
|
21
|
-
LifecycleHooks.AfterContentInit,
|
|
22
|
-
LifecycleHooks.AfterContentChecked,
|
|
23
|
-
LifecycleHooks.AfterViewInit,
|
|
17
|
+
LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges,
|
|
18
|
+
LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit,
|
|
24
19
|
LifecycleHooks.AfterViewChecked
|
|
25
20
|
];
|
|
21
|
+
/**
|
|
22
|
+
* Lifecycle hooks are guaranteed to be called in the following order:
|
|
23
|
+
* - `OnChanges` (if any bindings have changed),
|
|
24
|
+
* - `OnInit` (after the first check only),
|
|
25
|
+
* - `DoCheck`,
|
|
26
|
+
* - `AfterContentInit`,
|
|
27
|
+
* - `AfterContentChecked`,
|
|
28
|
+
* - `AfterViewInit`,
|
|
29
|
+
* - `AfterViewChecked`,
|
|
30
|
+
* - `OnDestroy` (at the very end before destruction)
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Implement this interface to get notified when any data-bound property of your directive changes.
|
|
34
|
+
*
|
|
35
|
+
* `ngOnChanges` is called right after the data-bound properties have been checked and before view
|
|
36
|
+
* and content children are checked if at least one of them has changed.
|
|
37
|
+
*
|
|
38
|
+
* The `changes` parameter contains an entry for each of the changed data-bound property. The key is
|
|
39
|
+
* the property name and the value is an instance of {@link SimpleChange}.
|
|
40
|
+
*
|
|
41
|
+
* ### Example ([live example](http://plnkr.co/edit/AHrB6opLqHDBPkt4KpdT?p=preview)):
|
|
42
|
+
*
|
|
43
|
+
* ```typescript
|
|
44
|
+
* @Component({
|
|
45
|
+
* selector: 'my-cmp',
|
|
46
|
+
* template: `<p>myProp = {{myProp}}</p>`
|
|
47
|
+
* })
|
|
48
|
+
* class MyComponent implements OnChanges {
|
|
49
|
+
* @Input() myProp: any;
|
|
50
|
+
*
|
|
51
|
+
* ngOnChanges(changes: SimpleChanges) {
|
|
52
|
+
* console.log('ngOnChanges - myProp = ' + changes['myProp'].currentValue);
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
*
|
|
56
|
+
* @Component({
|
|
57
|
+
* selector: 'app',
|
|
58
|
+
* template: `
|
|
59
|
+
* <button (click)="value = value + 1">Change MyComponent</button>
|
|
60
|
+
* <my-cmp [my-prop]="value"></my-cmp>`,
|
|
61
|
+
* directives: [MyComponent]
|
|
62
|
+
* })
|
|
63
|
+
* export class App {
|
|
64
|
+
* value = 0;
|
|
65
|
+
* }
|
|
66
|
+
*
|
|
67
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
68
|
+
* ```
|
|
69
|
+
* @stable
|
|
70
|
+
*/
|
|
71
|
+
var OnChanges = (function () {
|
|
72
|
+
function OnChanges() {
|
|
73
|
+
}
|
|
74
|
+
return OnChanges;
|
|
75
|
+
}());
|
|
76
|
+
exports.OnChanges = OnChanges;
|
|
77
|
+
/**
|
|
78
|
+
* Implement this interface to execute custom initialization logic after your directive's
|
|
79
|
+
* data-bound properties have been initialized.
|
|
80
|
+
*
|
|
81
|
+
* `ngOnInit` is called right after the directive's data-bound properties have been checked for the
|
|
82
|
+
* first time, and before any of its children have been checked. It is invoked only once when the
|
|
83
|
+
* directive is instantiated.
|
|
84
|
+
*
|
|
85
|
+
* ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview))
|
|
86
|
+
*
|
|
87
|
+
* ```typescript
|
|
88
|
+
* @Component({
|
|
89
|
+
* selector: 'my-cmp',
|
|
90
|
+
* template: `<p>my-component</p>`
|
|
91
|
+
* })
|
|
92
|
+
* class MyComponent implements OnInit, OnDestroy {
|
|
93
|
+
* ngOnInit() {
|
|
94
|
+
* console.log('ngOnInit');
|
|
95
|
+
* }
|
|
96
|
+
*
|
|
97
|
+
* ngOnDestroy() {
|
|
98
|
+
* console.log('ngOnDestroy');
|
|
99
|
+
* }
|
|
100
|
+
* }
|
|
101
|
+
*
|
|
102
|
+
* @Component({
|
|
103
|
+
* selector: 'app',
|
|
104
|
+
* template: `
|
|
105
|
+
* <button (click)="hasChild = !hasChild">
|
|
106
|
+
* {{hasChild ? 'Destroy' : 'Create'}} MyComponent
|
|
107
|
+
* </button>
|
|
108
|
+
* <my-cmp *ngIf="hasChild"></my-cmp>`,
|
|
109
|
+
* directives: [MyComponent, NgIf]
|
|
110
|
+
* })
|
|
111
|
+
* export class App {
|
|
112
|
+
* hasChild = true;
|
|
113
|
+
* }
|
|
114
|
+
*
|
|
115
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
116
|
+
* ```
|
|
117
|
+
* @stable
|
|
118
|
+
*/
|
|
119
|
+
var OnInit = (function () {
|
|
120
|
+
function OnInit() {
|
|
121
|
+
}
|
|
122
|
+
return OnInit;
|
|
123
|
+
}());
|
|
124
|
+
exports.OnInit = OnInit;
|
|
125
|
+
/**
|
|
126
|
+
* Implement this interface to supplement the default change detection algorithm in your directive.
|
|
127
|
+
*
|
|
128
|
+
* `ngDoCheck` gets called to check the changes in the directives in addition to the default
|
|
129
|
+
* algorithm.
|
|
130
|
+
*
|
|
131
|
+
* The default change detection algorithm looks for differences by comparing bound-property values
|
|
132
|
+
* by reference across change detection runs.
|
|
133
|
+
*
|
|
134
|
+
* Note that a directive typically should not use both `DoCheck` and {@link OnChanges} to respond to
|
|
135
|
+
* changes on the same input. `ngOnChanges` will continue to be called when the default change
|
|
136
|
+
* detector
|
|
137
|
+
* detects changes, so it is usually unnecessary to respond to changes on the same input in both
|
|
138
|
+
* hooks.
|
|
139
|
+
* Reaction to the changes have to be handled from within the `ngDoCheck` callback.
|
|
140
|
+
*
|
|
141
|
+
* You can use {@link KeyValueDiffers} and {@link IterableDiffers} to help add your custom check
|
|
142
|
+
* mechanisms.
|
|
143
|
+
*
|
|
144
|
+
* ### Example ([live demo](http://plnkr.co/edit/QpnIlF0CR2i5bcYbHEUJ?p=preview))
|
|
145
|
+
*
|
|
146
|
+
* In the following example `ngDoCheck` uses an {@link IterableDiffers} to detect the updates to the
|
|
147
|
+
* array `list`:
|
|
148
|
+
*
|
|
149
|
+
* ```typescript
|
|
150
|
+
* @Component({
|
|
151
|
+
* selector: 'custom-check',
|
|
152
|
+
* template: `
|
|
153
|
+
* <p>Changes:</p>
|
|
154
|
+
* <ul>
|
|
155
|
+
* <li *ngFor="let line of logs">{{line}}</li>
|
|
156
|
+
* </ul>`,
|
|
157
|
+
* directives: [NgFor]
|
|
158
|
+
* })
|
|
159
|
+
* class CustomCheckComponent implements DoCheck {
|
|
160
|
+
* @Input() list: any[];
|
|
161
|
+
* differ: any;
|
|
162
|
+
* logs = [];
|
|
163
|
+
*
|
|
164
|
+
* constructor(differs: IterableDiffers) {
|
|
165
|
+
* this.differ = differs.find([]).create(null);
|
|
166
|
+
* }
|
|
167
|
+
*
|
|
168
|
+
* ngDoCheck() {
|
|
169
|
+
* var changes = this.differ.diff(this.list);
|
|
170
|
+
*
|
|
171
|
+
* if (changes) {
|
|
172
|
+
* changes.forEachAddedItem(r => this.logs.push('added ' + r.item));
|
|
173
|
+
* changes.forEachRemovedItem(r => this.logs.push('removed ' + r.item))
|
|
174
|
+
* }
|
|
175
|
+
* }
|
|
176
|
+
* }
|
|
177
|
+
*
|
|
178
|
+
* @Component({
|
|
179
|
+
* selector: 'app',
|
|
180
|
+
* template: `
|
|
181
|
+
* <button (click)="list.push(list.length)">Push</button>
|
|
182
|
+
* <button (click)="list.pop()">Pop</button>
|
|
183
|
+
* <custom-check [list]="list"></custom-check>`,
|
|
184
|
+
* directives: [CustomCheckComponent]
|
|
185
|
+
* })
|
|
186
|
+
* export class App {
|
|
187
|
+
* list = [];
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
190
|
+
* @stable
|
|
191
|
+
*/
|
|
192
|
+
var DoCheck = (function () {
|
|
193
|
+
function DoCheck() {
|
|
194
|
+
}
|
|
195
|
+
return DoCheck;
|
|
196
|
+
}());
|
|
197
|
+
exports.DoCheck = DoCheck;
|
|
198
|
+
/**
|
|
199
|
+
* Implement this interface to get notified when your directive is destroyed.
|
|
200
|
+
*
|
|
201
|
+
* `ngOnDestroy` callback is typically used for any custom cleanup that needs to occur when the
|
|
202
|
+
* instance is destroyed
|
|
203
|
+
*
|
|
204
|
+
* ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview))
|
|
205
|
+
*
|
|
206
|
+
* ```typesript
|
|
207
|
+
* @Component({
|
|
208
|
+
* selector: 'my-cmp',
|
|
209
|
+
* template: `<p>my-component</p>`
|
|
210
|
+
* })
|
|
211
|
+
* class MyComponent implements OnInit, OnDestroy {
|
|
212
|
+
* ngOnInit() {
|
|
213
|
+
* console.log('ngOnInit');
|
|
214
|
+
* }
|
|
215
|
+
*
|
|
216
|
+
* ngOnDestroy() {
|
|
217
|
+
* console.log('ngOnDestroy');
|
|
218
|
+
* }
|
|
219
|
+
* }
|
|
220
|
+
*
|
|
221
|
+
* @Component({
|
|
222
|
+
* selector: 'app',
|
|
223
|
+
* template: `
|
|
224
|
+
* <button (click)="hasChild = !hasChild">
|
|
225
|
+
* {{hasChild ? 'Destroy' : 'Create'}} MyComponent
|
|
226
|
+
* </button>
|
|
227
|
+
* <my-cmp *ngIf="hasChild"></my-cmp>`,
|
|
228
|
+
* directives: [MyComponent, NgIf]
|
|
229
|
+
* })
|
|
230
|
+
* export class App {
|
|
231
|
+
* hasChild = true;
|
|
232
|
+
* }
|
|
233
|
+
*
|
|
234
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
235
|
+
* ```
|
|
236
|
+
*
|
|
237
|
+
*
|
|
238
|
+
* To create a stateful Pipe, you should implement this interface and set the `pure`
|
|
239
|
+
* parameter to `false` in the {@link PipeMetadata}.
|
|
240
|
+
*
|
|
241
|
+
* A stateful pipe may produce different output, given the same input. It is
|
|
242
|
+
* likely that a stateful pipe may contain state that should be cleaned up when
|
|
243
|
+
* a binding is destroyed. For example, a subscription to a stream of data may need to
|
|
244
|
+
* be disposed, or an interval may need to be cleared.
|
|
245
|
+
*
|
|
246
|
+
* ### Example ([live demo](http://plnkr.co/edit/i8pm5brO4sPaLxBx56MR?p=preview))
|
|
247
|
+
*
|
|
248
|
+
* In this example, a pipe is created to countdown its input value, updating it every
|
|
249
|
+
* 50ms. Because it maintains an internal interval, it automatically clears
|
|
250
|
+
* the interval when the binding is destroyed or the countdown completes.
|
|
251
|
+
*
|
|
252
|
+
* ```
|
|
253
|
+
* import {OnDestroy, Pipe, PipeTransform} from '@angular/core'
|
|
254
|
+
* @Pipe({name: 'countdown', pure: false})
|
|
255
|
+
* class CountDown implements PipeTransform, OnDestroy {
|
|
256
|
+
* remainingTime:Number;
|
|
257
|
+
* interval:SetInterval;
|
|
258
|
+
* ngOnDestroy() {
|
|
259
|
+
* if (this.interval) {
|
|
260
|
+
* clearInterval(this.interval);
|
|
261
|
+
* }
|
|
262
|
+
* }
|
|
263
|
+
* transform(value: any, args: any[] = []) {
|
|
264
|
+
* if (!parseInt(value, 10)) return null;
|
|
265
|
+
* if (typeof this.remainingTime !== 'number') {
|
|
266
|
+
* this.remainingTime = parseInt(value, 10);
|
|
267
|
+
* }
|
|
268
|
+
* if (!this.interval) {
|
|
269
|
+
* this.interval = setInterval(() => {
|
|
270
|
+
* this.remainingTime-=50;
|
|
271
|
+
* if (this.remainingTime <= 0) {
|
|
272
|
+
* this.remainingTime = 0;
|
|
273
|
+
* clearInterval(this.interval);
|
|
274
|
+
* delete this.interval;
|
|
275
|
+
* }
|
|
276
|
+
* }, 50);
|
|
277
|
+
* }
|
|
278
|
+
* return this.remainingTime;
|
|
279
|
+
* }
|
|
280
|
+
* }
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* Invoking `{{ 10000 | countdown }}` would cause the value to be decremented by 50,
|
|
284
|
+
* every 50ms, until it reaches 0.
|
|
285
|
+
*
|
|
286
|
+
* @stable
|
|
287
|
+
*/
|
|
288
|
+
var OnDestroy = (function () {
|
|
289
|
+
function OnDestroy() {
|
|
290
|
+
}
|
|
291
|
+
return OnDestroy;
|
|
292
|
+
}());
|
|
293
|
+
exports.OnDestroy = OnDestroy;
|
|
294
|
+
/**
|
|
295
|
+
* Implement this interface to get notified when your directive's content has been fully
|
|
296
|
+
* initialized.
|
|
297
|
+
*
|
|
298
|
+
* ### Example ([live demo](http://plnkr.co/edit/plamXUpsLQbIXpViZhUO?p=preview))
|
|
299
|
+
*
|
|
300
|
+
* ```typescript
|
|
301
|
+
* @Component({
|
|
302
|
+
* selector: 'child-cmp',
|
|
303
|
+
* template: `{{where}} child`
|
|
304
|
+
* })
|
|
305
|
+
* class ChildComponent {
|
|
306
|
+
* @Input() where: string;
|
|
307
|
+
* }
|
|
308
|
+
*
|
|
309
|
+
* @Component({
|
|
310
|
+
* selector: 'parent-cmp',
|
|
311
|
+
* template: `<ng-content></ng-content>`
|
|
312
|
+
* })
|
|
313
|
+
* class ParentComponent implements AfterContentInit {
|
|
314
|
+
* @ContentChild(ChildComponent) contentChild: ChildComponent;
|
|
315
|
+
*
|
|
316
|
+
* constructor() {
|
|
317
|
+
* // contentChild is not initialized yet
|
|
318
|
+
* console.log(this.getMessage(this.contentChild));
|
|
319
|
+
* }
|
|
320
|
+
*
|
|
321
|
+
* ngAfterContentInit() {
|
|
322
|
+
* // contentChild is updated after the content has been checked
|
|
323
|
+
* console.log('AfterContentInit: ' + this.getMessage(this.contentChild));
|
|
324
|
+
* }
|
|
325
|
+
*
|
|
326
|
+
* private getMessage(cmp: ChildComponent): string {
|
|
327
|
+
* return cmp ? cmp.where + ' child' : 'no child';
|
|
328
|
+
* }
|
|
329
|
+
* }
|
|
330
|
+
*
|
|
331
|
+
* @Component({
|
|
332
|
+
* selector: 'app',
|
|
333
|
+
* template: `
|
|
334
|
+
* <parent-cmp>
|
|
335
|
+
* <child-cmp where="content"></child-cmp>
|
|
336
|
+
* </parent-cmp>`,
|
|
337
|
+
* directives: [ParentComponent, ChildComponent]
|
|
338
|
+
* })
|
|
339
|
+
* export class App {
|
|
340
|
+
* }
|
|
341
|
+
*
|
|
342
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
343
|
+
* ```
|
|
344
|
+
* @stable
|
|
345
|
+
*/
|
|
346
|
+
var AfterContentInit = (function () {
|
|
347
|
+
function AfterContentInit() {
|
|
348
|
+
}
|
|
349
|
+
return AfterContentInit;
|
|
350
|
+
}());
|
|
351
|
+
exports.AfterContentInit = AfterContentInit;
|
|
352
|
+
/**
|
|
353
|
+
* Implement this interface to get notified after every check of your directive's content.
|
|
354
|
+
*
|
|
355
|
+
* ### Example ([live demo](http://plnkr.co/edit/tGdrytNEKQnecIPkD7NU?p=preview))
|
|
356
|
+
*
|
|
357
|
+
* ```typescript
|
|
358
|
+
* @Component({selector: 'child-cmp', template: `{{where}} child`})
|
|
359
|
+
* class ChildComponent {
|
|
360
|
+
* @Input() where: string;
|
|
361
|
+
* }
|
|
362
|
+
*
|
|
363
|
+
* @Component({selector: 'parent-cmp', template: `<ng-content></ng-content>`})
|
|
364
|
+
* class ParentComponent implements AfterContentChecked {
|
|
365
|
+
* @ContentChild(ChildComponent) contentChild: ChildComponent;
|
|
366
|
+
*
|
|
367
|
+
* constructor() {
|
|
368
|
+
* // contentChild is not initialized yet
|
|
369
|
+
* console.log(this.getMessage(this.contentChild));
|
|
370
|
+
* }
|
|
371
|
+
*
|
|
372
|
+
* ngAfterContentChecked() {
|
|
373
|
+
* // contentChild is updated after the content has been checked
|
|
374
|
+
* console.log('AfterContentChecked: ' + this.getMessage(this.contentChild));
|
|
375
|
+
* }
|
|
376
|
+
*
|
|
377
|
+
* private getMessage(cmp: ChildComponent): string {
|
|
378
|
+
* return cmp ? cmp.where + ' child' : 'no child';
|
|
379
|
+
* }
|
|
380
|
+
* }
|
|
381
|
+
*
|
|
382
|
+
* @Component({
|
|
383
|
+
* selector: 'app',
|
|
384
|
+
* template: `
|
|
385
|
+
* <parent-cmp>
|
|
386
|
+
* <button (click)="hasContent = !hasContent">Toggle content child</button>
|
|
387
|
+
* <child-cmp *ngIf="hasContent" where="content"></child-cmp>
|
|
388
|
+
* </parent-cmp>`,
|
|
389
|
+
* directives: [NgIf, ParentComponent, ChildComponent]
|
|
390
|
+
* })
|
|
391
|
+
* export class App {
|
|
392
|
+
* hasContent = true;
|
|
393
|
+
* }
|
|
394
|
+
*
|
|
395
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
396
|
+
* ```
|
|
397
|
+
* @stable
|
|
398
|
+
*/
|
|
399
|
+
var AfterContentChecked = (function () {
|
|
400
|
+
function AfterContentChecked() {
|
|
401
|
+
}
|
|
402
|
+
return AfterContentChecked;
|
|
403
|
+
}());
|
|
404
|
+
exports.AfterContentChecked = AfterContentChecked;
|
|
405
|
+
/**
|
|
406
|
+
* Implement this interface to get notified when your component's view has been fully initialized.
|
|
407
|
+
*
|
|
408
|
+
* ### Example ([live demo](http://plnkr.co/edit/LhTKVMEM0fkJgyp4CI1W?p=preview))
|
|
409
|
+
*
|
|
410
|
+
* ```typescript
|
|
411
|
+
* @Component({selector: 'child-cmp', template: `{{where}} child`})
|
|
412
|
+
* class ChildComponent {
|
|
413
|
+
* @Input() where: string;
|
|
414
|
+
* }
|
|
415
|
+
*
|
|
416
|
+
* @Component({
|
|
417
|
+
* selector: 'parent-cmp',
|
|
418
|
+
* template: `<child-cmp where="view"></child-cmp>`,
|
|
419
|
+
* directives: [ChildComponent]
|
|
420
|
+
* })
|
|
421
|
+
* class ParentComponent implements AfterViewInit {
|
|
422
|
+
* @ViewChild(ChildComponent) viewChild: ChildComponent;
|
|
423
|
+
*
|
|
424
|
+
* constructor() {
|
|
425
|
+
* // viewChild is not initialized yet
|
|
426
|
+
* console.log(this.getMessage(this.viewChild));
|
|
427
|
+
* }
|
|
428
|
+
*
|
|
429
|
+
* ngAfterViewInit() {
|
|
430
|
+
* // viewChild is updated after the view has been initialized
|
|
431
|
+
* console.log('ngAfterViewInit: ' + this.getMessage(this.viewChild));
|
|
432
|
+
* }
|
|
433
|
+
*
|
|
434
|
+
* private getMessage(cmp: ChildComponent): string {
|
|
435
|
+
* return cmp ? cmp.where + ' child' : 'no child';
|
|
436
|
+
* }
|
|
437
|
+
* }
|
|
438
|
+
*
|
|
439
|
+
* @Component({
|
|
440
|
+
* selector: 'app',
|
|
441
|
+
* template: `<parent-cmp></parent-cmp>`,
|
|
442
|
+
* directives: [ParentComponent]
|
|
443
|
+
* })
|
|
444
|
+
* export class App {
|
|
445
|
+
* }
|
|
446
|
+
*
|
|
447
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
448
|
+
* ```
|
|
449
|
+
* @stable
|
|
450
|
+
*/
|
|
451
|
+
var AfterViewInit = (function () {
|
|
452
|
+
function AfterViewInit() {
|
|
453
|
+
}
|
|
454
|
+
return AfterViewInit;
|
|
455
|
+
}());
|
|
456
|
+
exports.AfterViewInit = AfterViewInit;
|
|
457
|
+
/**
|
|
458
|
+
* Implement this interface to get notified after every check of your component's view.
|
|
459
|
+
*
|
|
460
|
+
* ### Example ([live demo](http://plnkr.co/edit/0qDGHcPQkc25CXhTNzKU?p=preview))
|
|
461
|
+
*
|
|
462
|
+
* ```typescript
|
|
463
|
+
* @Component({selector: 'child-cmp', template: `{{where}} child`})
|
|
464
|
+
* class ChildComponent {
|
|
465
|
+
* @Input() where: string;
|
|
466
|
+
* }
|
|
467
|
+
*
|
|
468
|
+
* @Component({
|
|
469
|
+
* selector: 'parent-cmp',
|
|
470
|
+
* template: `
|
|
471
|
+
* <button (click)="showView = !showView">Toggle view child</button>
|
|
472
|
+
* <child-cmp *ngIf="showView" where="view"></child-cmp>`,
|
|
473
|
+
* directives: [NgIf, ChildComponent]
|
|
474
|
+
* })
|
|
475
|
+
* class ParentComponent implements AfterViewChecked {
|
|
476
|
+
* @ViewChild(ChildComponent) viewChild: ChildComponent;
|
|
477
|
+
* showView = true;
|
|
478
|
+
*
|
|
479
|
+
* constructor() {
|
|
480
|
+
* // viewChild is not initialized yet
|
|
481
|
+
* console.log(this.getMessage(this.viewChild));
|
|
482
|
+
* }
|
|
483
|
+
*
|
|
484
|
+
* ngAfterViewChecked() {
|
|
485
|
+
* // viewChild is updated after the view has been checked
|
|
486
|
+
* console.log('AfterViewChecked: ' + this.getMessage(this.viewChild));
|
|
487
|
+
* }
|
|
488
|
+
*
|
|
489
|
+
* private getMessage(cmp: ChildComponent): string {
|
|
490
|
+
* return cmp ? cmp.where + ' child' : 'no child';
|
|
491
|
+
* }
|
|
492
|
+
* }
|
|
493
|
+
*
|
|
494
|
+
* @Component({
|
|
495
|
+
* selector: 'app',
|
|
496
|
+
* template: `<parent-cmp></parent-cmp>`,
|
|
497
|
+
* directives: [ParentComponent]
|
|
498
|
+
* })
|
|
499
|
+
* export class App {
|
|
500
|
+
* }
|
|
501
|
+
*
|
|
502
|
+
* bootstrap(App).catch(err => console.error(err));
|
|
503
|
+
* ```
|
|
504
|
+
* @stable
|
|
505
|
+
*/
|
|
506
|
+
var AfterViewChecked = (function () {
|
|
507
|
+
function AfterViewChecked() {
|
|
508
|
+
}
|
|
509
|
+
return AfterViewChecked;
|
|
510
|
+
}());
|
|
511
|
+
exports.AfterViewChecked = AfterViewChecked;
|
|
26
512
|
//# sourceMappingURL=lifecycle_hooks.js.map
|