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:
Buu Nguyen 2013-09-24 21:59:47 -05:00 committed by Brian Ford
parent 8e6e3ebad9
commit 40414827f4

View file

@ -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