4
這就是我實際上這樣做的方式,但在生成文檔後私有方法和屬性不可見。如何使用JSDoc3評論JS模塊模式類?
我做錯了什麼?
順便說一句,一切工作正常。我第一次使用文檔生成器,對此我印象非常深刻。
/**
* Constructor Description
* @constructor
* @class
* @classdesc Something about my class Foo.
*/
container.Foo = function() { this.init(); };
container.Foo.prototype = (function() {
/**
* @private
* @name container.Foo~fooPropertyPrivat
* @property {boolean} fooPropertyPrivat Some description
*/
var fooPropertyPrivat = true;
/**
* Some description
* @private
* @name container.Foo~doSomethingPrivat
* @memberOf container.Foo
* @method doSomethingPrivat
*/
function doSomethingPrivat() {
//...
}
return {
/**
* @public
* @name container.Foo#fooPropertyPublic
* @property {boolean} fooPropertyPublic Some description
*/
fooPropertyPublic: true,
/**
* Some description
* @public
* @constructs
* @name container.Foo#init
* @memberOf container.Foo
* @method init
*/
init: function() {
//...
}
};
})();