Question

I'm trying to create a documentation for my system but something's always wrong.

In the following, my Class appear in the module MyModule, perfect! But my function doesn't appear in the documentation!

Do you have any idea where the problem is coming from?

define([
    'underscore',
    'backbone'
], function(_, Backbone) {
    'use strict';

/**
 * MyModule
 *
 * @module MyModule
 */

var MyModule = {};

/**
 * Class description
 *
 * @class MyModule.View
 * @extends Backbone.View
 * @memberOf module:MyModule
 * @abstract
 */

MyModule.View = Backbone.View.extend(

   /** @lends MyModule.View  */

   {

    /**
     * myFunction1
     *
     * @param {object} hello Hello World!
     */

    myFunction1: function(hello) { }


   }

});

/**
 * Class description
 *
 * @class MyModule.Model
 * @extends Backbone.Model
 * @memberOf module:MyModule
 * @abstract
 */

MyModule.Model = Backbone.Model.extend();
    //etc...
});

Thanks

Was it helpful?

Solution

You have to prefix the name passed to @lends with the module name. See the @lends statement in this snipped I adapted from the code in your question:

MyModule.View = Backbone.View.extend(
    /** @lends module:MyModule.MyModule.View  */
    {

    /**
     * myFunction1
     *
     * @param {object} hello Hello World!
     */
    myFunction1: function(hello) { }
   });

With the @lends above, I'm able to get myFunction1 to show up, properly documented.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top