From 40414827f42c8fb86abb835f7387d5b02923d532 Mon Sep 17 00:00:00 2001 From: Buu Nguyen Date: Tue, 24 Sep 2013 21:59:47 -0500 Subject: 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. --- src/ng/compile.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.3