chore(dgeni): differentiate properties v methods. Closes driftyco/ionic-site#498

This commit is contained in:
perry
2016-04-18 17:36:43 -05:00
parent 0a83f2f260
commit 1c755dcb34
2 changed files with 10 additions and 4 deletions

View File

@ -12,6 +12,12 @@ module.exports = function collectInputsOutputs() {
memberLoop:
for (var i in doc.members) {
// identify properties to differentiate from methods
if (typeof doc.members[i].parameters == 'undefined') {
doc.members[i].isProperty = true;
}
if (doc.members[i].decorators && doc.members[i].decorators.length) {
decoratorLoop:

View File

@ -128,11 +128,11 @@ angular_controller: APIDemoCtrl <@ endif @>
<@- macro functionSyntax(fn) @>
<@- set sep = joiner(',&nbsp;') -@>
<code><$ fn.name $>(<@- for param in fn.params @><$ sep() $>
<code><$ fn.name $><@- if not fn.isProperty @>(<@ endif -@><@- for param in fn.params @><$ sep() $>
<@- if param.type.optional @>[<@ endif -@>
<$ param.name $>
<@- if param.type.optional @>]<@ endif -@>
<@ endfor @>)</code>
<@ endfor @><@- if not fn.isProperty @>)<@ endif -@></code>
<@ if fn.alias @><small>(alias: <$ fn.alias $>)</small><@ endif @>
<@ endmacro -@>
@ -249,7 +249,7 @@ Improve this doc
<@- if doc.statics.length -@>
<h2><a class="anchor" name="static-methods" href="#static-methods"></a>Static Methods</h2>
<h2><a class="anchor" name="static-members" href="#static-members"></a>Static Members</h2>
<@- for method in doc.statics @><@ if not method.internal @>
<div id="<$ method.name $>"></div>
<h3><a class="anchor" name="<$ method.name $>" href="#<$ method.name $>"></a><$ functionSyntax(method) $></h3>
@ -283,7 +283,7 @@ Improve this doc
<!-- instance methods on the class -->
<@- if doc.members and doc.members.length @>
<h2><a class="anchor" name="instance-methods" href="#instance-methods"></a>Instance Methods</h2>
<h2><a class="anchor" name="instance-members" href="#instance-members"></a>Instance Members</h2>
<@- for method in doc.members @>
<div id="<$ method.name $>"></div>