@@ -130,22 +130,19 @@ export abstract class OnChanges { abstract ngOnChanges(changes: SimpleChanges);
130
130
export abstract class OnInit { abstract ngOnInit ( ) ; }
131
131
132
132
/**
133
- * Implement this interface to override the default change detection algorithm for your directive.
133
+ * Implement this interface to supplement the default change detection algorithm in your directive.
134
134
*
135
- * `ngDoCheck` gets called to check the changes in the directives instead of the default algorithm.
135
+ * `ngDoCheck` gets called to check the changes in the directives in addition to the default algorithm.
136
136
*
137
137
* The default change detection algorithm looks for differences by comparing bound-property values
138
- * by reference across change detection runs. When `DoCheck` is implemented, the default algorithm
139
- * is disabled and `ngDoCheck` is responsible for checking for changes.
138
+ * by reference across change detection runs.
140
139
*
141
- * Implementing this interface allows improving performance by using insights about the component,
142
- * its implementation and data types of its properties.
140
+ * Note that a directive typically should not use both `DoCheck` and {@link OnChanges} to respond to
141
+ * changes on the same input. `ngOnChanges` will continue to be called when the default change detector
142
+ * detects changes, so it is usually unnecessary to respond to changes on the same input in both hooks.
143
+ * Reaction to the changes have to be handled from within the `ngDoCheck` callback.
143
144
*
144
- * Note that a directive should not implement both `DoCheck` and {@link OnChanges} at the same time.
145
- * `ngOnChanges` would not be called when a directive implements `DoCheck`. Reaction to the changes
146
- * have to be handled from within the `ngDoCheck` callback.
147
- *
148
- * Use {@link KeyValueDiffers} and {@link IterableDiffers} to add your custom check mechanisms.
145
+ * You can use {@link KeyValueDiffers} and {@link IterableDiffers} to help add your custom check mechanisms.
149
146
*
150
147
* ### Example ([live demo](http://plnkr.co/edit/QpnIlF0CR2i5bcYbHEUJ?p=preview))
151
148
*
0 commit comments