Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just struggled with this for several hours. I tried:</p> <ul> <li><code>@member</code></li> <li><code>@augments</code></li> <li><code>@method</code></li> <li><code>@this</code></li> </ul> <p>From the examples and tutorials I found, member functions and variables <em>should</em> appear in the output simply by having <code>/** description/*</code> comments above them, but I found that was not the case. Like you, I'm using standard JavaScript constructors, where <code>this</code> should be able to be inferred automatically due to the <code>@constructor</code> being in place. Maybe there's some wrinkle I'm not seeing.</p> <p>In the end, I found two tags that worked for me, <a href="http://usejsdoc.org/tags-name.html" rel="nofollow noreferrer"><code>@name</code></a> and<a href="http://usejsdoc.org/tags-memberof.html" rel="nofollow noreferrer"><code>@memberof</code></a>. They both allow you to specify the object that the property is a member of. Using <code>@name</code> in this way is undocumented (at least, I didn't see it anywhere), but very straightforward. You'll also need to use <code>@function</code>.</p> <p>Here's an example with the <code>@name</code> tag:</p> <pre><code>/** help function * @name Sample.try * @function * @param {String} Name */ this.try=function(name){ console.log('try me'+name); }; </code></pre> <p><img src="https://i.stack.imgur.com/UcaHJ.png" alt="enter image description here"></p> <p>And here's an example with the <code>@memberof</code> tag:</p> <pre><code>/** help function * @memberof Sample * @function * @param {String} Name */ this.try=function(name){ console.log('try me'+name); }; </code></pre> <p><img src="https://i.stack.imgur.com/KJNM2.png" alt="enter image description here"></p> <p>As you can see the output is almost the same. The only difference that I see is that <code>@memberof</code> includes <code>this.</code> in the method name. For that reason I've settled on using <code>@name</code>.</p> <p>The remaining issue is that the functions are per-instance, not <code>&lt;static&gt;</code>.</p> <p>Hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload