【发布时间】:2013-02-28 21:15:11
【问题描述】:
我正在尝试在一个名为 User 的类中记录功能,该类位于闭包内 - 我如何使用 JsDoc3 做到这一点?
这是我所拥有的:
/**
@class User
@classdesc This is the class that describes each user.
*/
(function($){
var _defaults = {
'first_name': '',
'last_name': ''
};
/**
@constructor
*/
function User(options) {
this.options = $.extend({}, _defaults, options);
}
/**
@method
@desc Returns the combined first name and last name as a string
@returns {string}
*/
User.prototype.getName() = function(){
return this.options.first_name + this.options.last_name;
};
window.User = User;
}(jQuery));
【问题讨论】:
标签: javascript documentation closures jsdoc