aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Minar2010-11-17 13:07:59 -0800
committerIgor Minar2010-11-18 02:34:54 -0800
commitee0e9a44521218a1d13bc502350414d30ca03cf9 (patch)
tree4d42221bdcae1f85d83673e9ae71d6061b802388
parent9d36368ff9cb84a38ba0ab08c0d54361bd836389 (diff)
downloadangular.js-ee0e9a44521218a1d13bc502350414d30ca03cf9.tar.bz2
adding support for @param.optional
-rw-r--r--docs/collect.js1
-rw-r--r--docs/spec/collectSpec.js8
2 files changed, 6 insertions, 3 deletions
diff --git a/docs/collect.js b/docs/collect.js
index d9556747..70a1ffbf 100644
--- a/docs/collect.js
+++ b/docs/collect.js
@@ -252,6 +252,7 @@ var TAG = {
var param = {
type: match[2],
name: match[6] || match[5],
+ optional: !!match[3],
'default':match[7],
description:markdownNoP(value.replace(match[0], match[8]))
};
diff --git a/docs/spec/collectSpec.js b/docs/spec/collectSpec.js
index b61097f6..822e97fb 100644
--- a/docs/spec/collectSpec.js
+++ b/docs/spec/collectSpec.js
@@ -83,16 +83,18 @@ describe('collect', function(){
'{(number|string)} number Number \n to format.');
expect(doc.param).toEqual([{
type : '(number|string)',
- name : 'number',
+ name : 'number',
+ optional: false,
'default' : undefined,
description : 'Number \n to format.' }]);
});
- it('should parse with default', function(){
+ it('should parse with default and optional', function(){
TAG.param(doc, 'param',
'{(number|string)=} [fractionSize=2] desc');
expect(doc.param).toEqual([{
type : '(number|string)',
- name : 'fractionSize',
+ name : 'fractionSize',
+ optional: true,
'default' : '2',
description : 'desc' }]);
});