| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2019-01-16 09:35:35 -08:00
										 |  |  | import {SimpleChanges} from './simple_change'; | 
					
						
							| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-09 15:45:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 13:14:59 -07:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2016-09-14 09:42:41 -07:00
										 |  |  |  * @description | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * A lifecycle hook that is called when any data-bound property of a directive changes. | 
					
						
							|  |  |  |  * Define an `ngOnChanges()` method to handle the changes. | 
					
						
							| 
									
										
										
										
											2018-04-05 10:16:31 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @see `DoCheck` | 
					
						
							|  |  |  |  * @see `OnInit` | 
					
						
							|  |  |  |  * @see [Lifecycle Hooks](guide/lifecycle-hooks#onchanges) guide | 
					
						
							| 
									
										
										
										
											2015-08-31 18:32:32 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @usageNotes | 
					
						
							|  |  |  |  * The following snippet shows how a component can implement this interface to | 
					
						
							|  |  |  |  * define an on-changes handler for an input property. | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnChanges'} | 
					
						
							| 
									
										
										
										
											2018-04-05 22:31:44 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * @publicApi | 
					
						
							| 
									
										
										
										
											2015-05-27 08:07:37 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  | export interface OnChanges { | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * A callback method that is invoked immediately after the | 
					
						
							|  |  |  |    * default change detector has checked data-bound properties | 
					
						
							|  |  |  |    * if at least one has changed, and before the view and content | 
					
						
							|  |  |  |    * children are checked. | 
					
						
							|  |  |  |    * @param changes The changed properties. | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   ngOnChanges(changes: SimpleChanges): void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2015-05-27 08:07:37 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-27 10:14:37 -07:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2016-09-14 09:42:41 -07:00
										 |  |  |  * @description | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * A lifecycle hook that is called after Angular has initialized | 
					
						
							|  |  |  |  * all data-bound properties of a directive. | 
					
						
							|  |  |  |  * Define an `ngOnInit()` method to handle any additional initialization tasks. | 
					
						
							| 
									
										
										
										
											2018-04-05 10:16:31 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @see `AfterContentInit` | 
					
						
							|  |  |  |  * @see [Lifecycle Hooks](guide/lifecycle-hooks#onchanges) guide | 
					
						
							| 
									
										
										
										
											2015-08-31 18:32:32 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @usageNotes | 
					
						
							|  |  |  |  * The following snippet shows how a component can implement this interface to | 
					
						
							|  |  |  |  * define its own initialization method. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnInit'} | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * @publicApi | 
					
						
							| 
									
										
										
										
											2015-05-27 10:14:37 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  | export interface OnInit { | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * A callback method that is invoked immediately after the | 
					
						
							|  |  |  |    * default change detector has checked the directive's | 
					
						
							|  |  |  |    * data-bound properties for the first time, | 
					
						
							|  |  |  |    * and before any of the view or content children have been checked. | 
					
						
							|  |  |  |    * It is invoked only once when the directive is instantiated. | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   ngOnInit(): void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2015-05-27 10:14:37 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * A lifecycle hook that invokes a custom change-detection function for a directive, | 
					
						
							|  |  |  |  * in addition to the check performed by the default change-detector. | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * The default change-detection algorithm looks for differences by comparing | 
					
						
							|  |  |  |  * bound-property values by reference across change detection runs. You can use this | 
					
						
							|  |  |  |  * hook to check for and respond to changes by some other means. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * When the default change detector detects changes, it invokes `ngOnChanges()` if supplied, | 
					
						
							|  |  |  |  * regardless of whether you perform additional change detection. | 
					
						
							|  |  |  |  * Typically, you should not use both `DoCheck` and `OnChanges` to respond to | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * changes on the same input. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @see `OnChanges` | 
					
						
							|  |  |  |  * @see [Lifecycle Hooks](guide/lifecycle-hooks#onchanges) guide | 
					
						
							| 
									
										
										
										
											2015-08-31 18:32:32 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @usageNotes | 
					
						
							|  |  |  |  * The following snippet shows how a component can implement this interface | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * to invoke it own change-detection cycle. | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='DoCheck'} | 
					
						
							| 
									
										
										
										
											2018-04-05 22:31:44 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * @publicApi | 
					
						
							| 
									
										
										
										
											2015-05-27 10:14:37 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  | export interface DoCheck { | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |      * A callback method that performs change-detection, invoked | 
					
						
							|  |  |  |      * after the default change-detector runs. | 
					
						
							| 
									
										
										
										
											2018-07-18 10:26:59 -07:00
										 |  |  |      * See `KeyValueDiffers` and `IterableDiffers` for implementing | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |      * custom change checking for collections. | 
					
						
							| 
									
										
										
										
											2018-07-18 10:26:59 -07:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |      */ | 
					
						
							|  |  |  |   ngDoCheck(): void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2015-05-27 10:14:37 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-28 18:11:04 -07:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * A lifecycle hook that is called when a directive, pipe, or service is destroyed. | 
					
						
							|  |  |  |  * Use for any custom cleanup that needs to occur when the | 
					
						
							|  |  |  |  * instance is destroyed. | 
					
						
							|  |  |  |  * @see [Lifecycle Hooks](guide/lifecycle-hooks#onchanges) guide | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-04-05 09:58:02 +01:00
										 |  |  |  * @usageNotes | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * The following snippet shows how a component can implement this interface | 
					
						
							| 
									
										
										
										
											2018-07-18 10:26:59 -07:00
										 |  |  |  * to define its own custom clean-up method. | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2016-09-14 09:42:41 -07:00
										 |  |  |  * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnDestroy'} | 
					
						
							| 
									
										
										
										
											2015-08-31 18:32:32 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * @publicApi | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  */ | 
					
						
							|  |  |  | export interface OnDestroy { | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * A callback method that performs custom clean-up, invoked immediately | 
					
						
							|  |  |  |    * after a directive, pipe, or service instance is destroyed. | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   ngOnDestroy(): void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2016-09-14 09:42:41 -07:00
										 |  |  |  * @description | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * A lifecycle hook that is called after Angular has fully initialized | 
					
						
							|  |  |  |  * all content of a directive. | 
					
						
							|  |  |  |  * Define an `ngAfterContentInit()` method to handle any additional initialization tasks. | 
					
						
							| 
									
										
										
										
											2018-04-05 10:16:31 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @see `OnInit` | 
					
						
							|  |  |  |  * @see `AfterViewInit` | 
					
						
							|  |  |  |  * @see [Lifecycle Hooks](guide/lifecycle-hooks#onchanges) guide | 
					
						
							| 
									
										
										
										
											2015-11-17 10:09:23 -08:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @usageNotes | 
					
						
							|  |  |  |  * The following snippet shows how a component can implement this interface to | 
					
						
							|  |  |  |  * define its own content initialization method. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentInit'} | 
					
						
							| 
									
										
										
										
											2015-11-17 10:09:23 -08:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * @publicApi | 
					
						
							| 
									
										
										
										
											2015-08-28 18:11:04 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  | export interface AfterContentInit { | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * A callback method that is invoked immediately after | 
					
						
							|  |  |  |    * Angular has completed initialization of all of the directive's | 
					
						
							|  |  |  |    * content. | 
					
						
							|  |  |  |    * It is invoked only once when the directive is instantiated. | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   ngAfterContentInit(): void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2015-08-28 18:11:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-27 08:07:37 -07:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @description | 
					
						
							|  |  |  |  * A lifecycle hook that is called after the default change detector has | 
					
						
							|  |  |  |  * completed checking all content of a directive. | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @see `AfterViewChecked` | 
					
						
							|  |  |  |  * @see [Lifecycle Hooks](guide/lifecycle-hooks#onchanges) guide | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @usageNotes | 
					
						
							|  |  |  |  * The following snippet shows how a component can implement this interface to | 
					
						
							|  |  |  |  * define its own after-check functionality. | 
					
						
							| 
									
										
										
										
											2018-04-05 10:16:31 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentChecked'} | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * @publicApi | 
					
						
							| 
									
										
										
										
											2015-05-27 08:07:37 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  | export interface AfterContentChecked { | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * A callback method that is invoked immediately after the | 
					
						
							|  |  |  |    * default change detector has completed checking all of the directive's | 
					
						
							|  |  |  |    * content. | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   ngAfterContentChecked(): void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2015-08-28 18:11:04 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2016-09-14 09:42:41 -07:00
										 |  |  |  * @description | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * A lifecycle hook that is called after Angular has fully initialized | 
					
						
							|  |  |  |  * a component's view. | 
					
						
							|  |  |  |  * Define an `ngAfterViewInit()` method to handle any additional initialization tasks. | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @see `OnInit` | 
					
						
							|  |  |  |  * @see `AfterContentInit` | 
					
						
							|  |  |  |  * @see [Lifecycle Hooks](guide/lifecycle-hooks#onchanges) guide | 
					
						
							| 
									
										
										
										
											2018-04-05 22:31:44 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-04-05 09:58:02 +01:00
										 |  |  |  * @usageNotes | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * The following snippet shows how a component can implement this interface to | 
					
						
							|  |  |  |  * define its own view initialization method. | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewInit'} | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * @publicApi | 
					
						
							| 
									
										
										
										
											2015-08-28 18:11:04 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  | export interface AfterViewInit { | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * A callback method that is invoked immediately after | 
					
						
							|  |  |  |    * Angular has completed initialization of a component's view. | 
					
						
							|  |  |  |    * It is invoked only once when the view is instantiated. | 
					
						
							|  |  |  |    * | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   ngAfterViewInit(): void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2015-08-31 18:32:32 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2016-09-14 09:42:41 -07:00
										 |  |  |  * @description | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * A lifecycle hook that is called after the default change detector has | 
					
						
							|  |  |  |  * completed checking a component's view for changes. | 
					
						
							| 
									
										
										
										
											2018-04-05 10:16:31 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @see `AfterContentChecked` | 
					
						
							|  |  |  |  * @see [Lifecycle Hooks](guide/lifecycle-hooks#onchanges) guide | 
					
						
							| 
									
										
										
										
											2015-09-24 15:40:50 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  |  * @usageNotes | 
					
						
							|  |  |  |  * The following snippet shows how a component can implement this interface to | 
					
						
							|  |  |  |  * define its own after-check functionality. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewChecked'} | 
					
						
							| 
									
										
										
										
											2018-04-05 22:31:44 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2018-10-19 16:27:04 +01:00
										 |  |  |  * @publicApi | 
					
						
							| 
									
										
										
										
											2015-08-31 18:32:32 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-07-02 12:06:52 -07:00
										 |  |  | export interface AfterViewChecked { | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * A callback method that is invoked immediately after the | 
					
						
							|  |  |  |    * default change detector has completed one change-check cycle | 
					
						
							|  |  |  |    * for a component's view. | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   ngAfterViewChecked(): void; | 
					
						
							|  |  |  | } |