Function Javascript闭包或匿名函数中类的JSDOC

Function Javascript闭包或匿名函数中类的JSDOC,function,anonymous,jsdoc,Function,Anonymous,Jsdoc,我想在AngularJS代码中添加jsdoc注释,因此我尝试: PageFactory.js /** * Creates an instance of PageFactory. * * @constructor * @this {PageFactory} * */ function PageFactory() { } angular.module ( 'app' ).factory ('PageFactory', PageFactory); (function (){

我想在AngularJS代码中添加jsdoc注释,因此我尝试:

PageFactory.js

/**
 * Creates an instance of PageFactory.
 *
 * @constructor
 * @this {PageFactory}
 * 
*/
function PageFactory() {
}

angular.module ( 'app' ).factory ('PageFactory', PageFactory);
(function (){

    /**
     * Creates an instance of PageFactory.
     *
     * @constructor
     * @this {PageFactory}
     * 
    */
    function PageFactory() {
    }

    angular.module ( 'app' ).factory ('PageFactory', PageFactory);

})();
上述方法工作良好,并生成预期的jsdoc输出。但当我将这些代码包含在一个匿名函数中时,如下所示:

PageFactory.js

/**
 * Creates an instance of PageFactory.
 *
 * @constructor
 * @this {PageFactory}
 * 
*/
function PageFactory() {
}

angular.module ( 'app' ).factory ('PageFactory', PageFactory);
(function (){

    /**
     * Creates an instance of PageFactory.
     *
     * @constructor
     * @this {PageFactory}
     * 
    */
    function PageFactory() {
    }

    angular.module ( 'app' ).factory ('PageFactory', PageFactory);

})();
生成的jsdoc html输出为空,并且没有关于PageFactory类的文档

有没有办法让jsdoc使用匿名函数,或者使用我的第二个代码

提前感谢。

像这样使用
@lends

(/** @lends <global> */ function (){
// etc... the rest remains the same.
(/**@lends*/函数(){
//等等,其余的还是一样的。

谢谢,伙计,这很有帮助。虽然前面的类有~但是它和我想要的一样好。很高兴提供帮助。请查看以了解
~
和其他符号的含义。