From f7dbf46bad20fea0b564c890c24ca1c2c4548490 Mon Sep 17 00:00:00 2001 From: Butch Peters Date: Tue, 10 Sep 2013 20:13:15 -0500 Subject: [PATCH] docs(Attributes): Add missing documentation for $observe method - Add proper ngdoc annotations to existing $observe documentation - Add link to directive guide for usage example of $observe - Add note about $observe function parameter signature --- src/ng/compile.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index 7a2ee4e7fcf8..6bde4d2253a8 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -418,12 +418,20 @@ function $CompileProvider($provide) { /** + * @ngdoc function + * @name ng.$compile.directive.Attributes#$observe + * @methodOf ng.$compile.directive.Attributes + * @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. * * @param {string} key Normalized key. (ie ngAttribute) . - * @param {function(*)} fn Function that will be called whenever the attribute value changes. - * @returns {function(*)} the `fn` Function passed in. + * @param {function(attrValue)} fn Function that will be called whenever the attribute value changes. + * See the {@link guide/directive#Attributes Directive guide} for more info. + * @returns {function()} the `fn` Function passed in. */ $observe: function(key, fn) { var attrs = this,