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

Commit

Permalink
docs($compile): improve explanation of Attributes.$observe
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
buunguyen authored and btford committed Oct 2, 2013
1 parent 8e6e3eb commit 4041482
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,11 @@ function $CompileProvider($provide) {
* @function
*
* @description
* Observe an interpolated attribute.
* The observer will never be called, if given attribute is not interpolated.
* The interpolated value of the attribute is passed to the observer function.
* Observes an interpolated attribute.
*
* The observer function will be invoked once during the next `$digest` following
* compilation. The observer is then invoked whenever the interpolated value
* changes.
*
* @param {string} key Normalized key. (ie ngAttribute) .
* @param {function(interpolatedValue)} fn Function that will be called whenever
Expand Down

0 comments on commit 4041482

Please sign in to comment.