diff options
| author | Dag-Inge Aas | 2013-09-10 18:06:18 +0200 | 
|---|---|---|
| committer | Matias Niemelä | 2013-09-30 12:05:33 -0400 | 
| commit | 448bd14445e7f8a8aabaa555d43bbf7dff50d58d (patch) | |
| tree | 9db2ef3f8263096142e1158764d7cd58695a72a6 /docs/src/ngdoc.js | |
| parent | 1618adfab1bfc3478786798fa55e8a767f52043f (diff) | |
| download | angular.js-448bd14445e7f8a8aabaa555d43bbf7dff50d58d.tar.bz2 | |
fix(ngdoc): add default values to ngdoc template
ngDoc did not add default value to template, even though it was present
in the documentation. This change adds the default value to the
description column in the parameters table.
Closes #3950
Diffstat (limited to 'docs/src/ngdoc.js')
| -rw-r--r-- | docs/src/ngdoc.js | 12 | 
1 files changed, 9 insertions, 3 deletions
| diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 0eacada0..0f94f6eb 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -482,7 +482,7 @@ Doc.prototype = {              description:self.markdown(text.replace(match[0], match[6])),              type: optional ? match[1].substring(0, match[1].length-1) : match[1],              optional: optional, -            'default':match[5] +            default: match[5]            };            self.param.push(param);          } else if (atName == 'returns' || atName == 'return') { @@ -629,7 +629,6 @@ Doc.prototype = {            types = types.substr(0,limit);          }          types = types.split(/\|(?![\(\)\w\|\s]+>)/); -        var description = param.description;          if (param.optional) {            name += ' <div><em>(optional)</em></div>';          } @@ -642,8 +641,15 @@ Doc.prototype = {            dom.text(type);            dom.html('</a>');          } +          dom.html('</td>'); -        dom.html('<td>' + description + '</td>'); +        var description = '<td>'; +        description += param.description; +        if (param.default) { +          description += ' <p><em>(default: ' + param.default + ')</em></p>'; +        } +        description += '</td>'; +        dom.html(description);          dom.html('</tr>');        };        dom.html('</tbody>'); | 
