angular-jsdoc icon indicating copy to clipboard operation
angular-jsdoc copied to clipboard

Controller properties not being displayed in generated docs

Open ghost opened this issue 9 years ago • 4 comments
trafficstars

In the example files for documenting a controller:

    /**
     * @property {Hash} _objects collection og objects that belongs to this map
     */
    this._objects = {};

but the output.js file doesn't contain this property.

Any advice for documenting controller properties or/and why the example doesn't work?

ghost avatar May 18 '16 14:05 ghost

Could you please provide the whole code of the controller?

Zemke avatar May 18 '16 21:05 Zemke

If you used @name for the parent docblock it will ignore all nested docblocks. Post your objects docblock.

reloaded avatar May 18 '16 22:05 reloaded

@Zemke @reloaded this is the case on your example map-controller: https://github.com/allenhwkim/angular-jsdoc/blob/master/sample-codes/ngmap/map-controller.js - The output: https://rawgit.com/allenhwkim/angular-jsdoc/master/angular-template/docs/ngmap.MapController.html doesn't show "_objects" in the generated docs

ghost avatar May 19 '16 08:05 ghost

It will work if you add the "@memberof" annotation like so:

    /**
     * @memberof MapController
     * @property {Hash} _objects collection og objects that belongs to this map
     */
    this._objects = {};

The example seems to be missing it and that's basically it.

I've been documenting a quite complex AnguarJS/NodeJS/Browserify project for the last few days and any visibility problems went away when I realized that I need to add a proper "@memberof" to every entry, for example:

/**
 * @memberof module_name
 */

for top level entries

/**
 *@memberof module_name.DirectiveName
 */

for entries nested in a directive, which has a "@name DirectiveName" and "@memberof module_name"

It's a basic parent-child relation from what I figured. It's a bit annoying to have to add this to every inner part you want to document, but I guess writing a parser that would know where it currently is (inside or outside of a function/class, etc.) would be a lot of work.

Maybe the docs should have a short notice about it?

TeHMoroS avatar Jun 15 '16 07:06 TeHMoroS