aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBuu Nguyen2013-09-24 21:59:47 -0500
committerBrian Ford2013-10-02 10:54:16 -0700
commit40414827f42c8fb86abb835f7387d5b02923d532 (patch)
treef45d0290a5607d7ec6d632eb4d3f7b3d8c80343a
parent8e6e3ebad991eaf57a7885549ea3b91932d495c9 (diff)
downloadangular.js-40414827f42c8fb86abb835f7387d5b02923d532.tar.bz2
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.
-rw-r--r--src/ng/compile.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ng/compile.js b/src/ng/compile.js
index 4f466292..2b70abfc 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -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