mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
adding support for @param.optional
This commit is contained in:
parent
9d36368ff9
commit
ee0e9a4452
2 changed files with 6 additions and 3 deletions
|
|
@ -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]))
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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' }]);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue