mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
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.
This commit is contained in:
parent
8e6e3ebad9
commit
40414827f4
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue