From 21c70729d9269de85df3434c431c2f18995b0f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matias=20Niemel=C3=A4?= Date: Mon, 20 May 2013 21:00:12 -0400 Subject: [PATCH] feat(ngdocs): provide support for inline variable hinting --- docs/spec/ngdocSpec.js | 5 +++++ docs/src/ngdoc.js | 4 ++++ src/ng/directive/ngRepeat.js | 10 ++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js index 3cd9834b9423..9eed24ca28db 100644 --- a/docs/spec/ngdocSpec.js +++ b/docs/spec/ngdocSpec.js @@ -150,6 +150,11 @@ describe('ngdoc', function() { toMatch('\n\n

One

\n\n/); + }); + it('should ignore nested doc widgets', function() { expect(new Doc().markdown( 'before
\n' + diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 7c07f00ffdcf..d66f33e64b0c 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -214,6 +214,10 @@ Doc.prototype = { (title || url).replace(/^#/g, '').replace(/\n/g, ' ') + (isAngular ? '' : '') + ''; + }). + replace(/{@type\s+(\S+)(?:\s+(\S+))?}/g, function(_, type, url) { + url = url || '#'; + return '' + type + ''; }); }); text = parts.join(''); diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js index 6c2da071956d..89b402c87b20 100644 --- a/src/ng/directive/ngRepeat.js +++ b/src/ng/directive/ngRepeat.js @@ -11,10 +11,12 @@ * * Special properties are exposed on the local scope of each template instance, including: * - * * `$index` – `{number}` – iterator offset of the repeated element (0..length-1) - * * `$first` – `{boolean}` – true if the repeated element is first in the iterator. - * * `$middle` – `{boolean}` – true if the repeated element is between the first and last in the iterator. - * * `$last` – `{boolean}` – true if the repeated element is last in the iterator. + * | Variable | Type | Details | + * |===========|=================|=============================================================================| + * | `$index` | {@type number} | iterator offset of the repeated element (0..length-1) | + * | `$first` | {@type boolean} | true if the repeated element is first in the iterator. | + * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. | + * | `$last` | {@type boolean} | true if the repeated element is last in the iterator. | * * Additionally, you can also provide animations via the ngAnimate attribute to animate the **enter**, * **leave** and **move** effects.