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

Commit 4041482

Browse files
buunguyenbtford
authored andcommitted
docs($compile): improve explanation of Attributes.$observe
The current comment of Attributes.$observe doesn't state correctly the behavior when the attribute contains no interpolation. Specifically, it states that the observer function will never be invoked if the attribute contains no interpolation. However, the actual behavior in this case is that the observer will be invoked once during the next digest loop.
1 parent 8e6e3eb commit 4041482

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ng/compile.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,11 @@ function $CompileProvider($provide) {
425425
* @function
426426
*
427427
* @description
428-
* Observe an interpolated attribute.
429-
* The observer will never be called, if given attribute is not interpolated.
430-
* The interpolated value of the attribute is passed to the observer function.
428+
* Observes an interpolated attribute.
429+
*
430+
* The observer function will be invoked once during the next `$digest` following
431+
* compilation. The observer is then invoked whenever the interpolated value
432+
* changes.
431433
*
432434
* @param {string} key Normalized key. (ie ngAttribute) .
433435
* @param {function(interpolatedValue)} fn Function that will be called whenever

0 commit comments

Comments
 (0)