Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 3fc4d60

Browse files
gracebenzgkalpak
authored andcommitted
docs($compile): add some detail about $onChanges
Closes #15604
1 parent 2eb12a0 commit 3fc4d60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ng/compile.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@
128128
* * `$onChanges(changesObj)` - Called whenever one-way (`<`) or interpolation (`@`) bindings are updated. The
129129
* `changesObj` is a hash whose keys are the names of the bound properties that have changed, and the values are an
130130
* object of the form `{ currentValue, previousValue, isFirstChange() }`. Use this hook to trigger updates within a
131-
* component such as cloning the bound value to prevent accidental mutation of the outer value.
131+
* component such as cloning the bound value to prevent accidental mutation of the outer value. Note that this will
132+
* also be called when your bindings are initialized.
132133
* * `$doCheck()` - Called on each turn of the digest cycle. Provides an opportunity to detect and act on
133134
* changes. Any actions that you wish to take in response to the changes that you detect must be
134135
* invoked from this hook; implementing this has no effect on when `$onChanges` is called. For example, this hook

0 commit comments

Comments
 (0)