diff options
| author | Butch Peters | 2013-09-10 20:13:15 -0500 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-09-11 12:11:38 +0100 |
| commit | 26685782b36b7d7c5eed88df76ddd39405202b43 (patch) | |
| tree | c7648b91c209fe6bab166ac3e85da68caca4e703 | |
| parent | d63a50c3c306377b3b1afd3e36ff821b6e23bfeb (diff) | |
| download | angular.js-26685782b36b7d7c5eed88df76ddd39405202b43.tar.bz2 | |
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
Closes #3957
| -rw-r--r-- | src/ng/compile.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ng/compile.js b/src/ng/compile.js index 7a2ee4e7..d97aeaf6 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -418,12 +418,21 @@ 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(interpolatedValue)} fn Function that will be called whenever + the interpolated value of the attribute changes. + * See the {@link guide/directive#Attributes Directives} guide for more info. + * @returns {function()} the `fn` parameter. */ $observe: function(key, fn) { var attrs = this, |
