문제

I wanted to add jsdoc annotations to my AngularJS codes, so i tried :

PageFactory.js

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

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

The above works fine and produces the expected jsdoc output. But when i enclose this codes in an anonymous function like this :

PageFactory.js

(function (){

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

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

})();

The generated jsdoc html output is blank and no documentation on PageFactory class.

Is theres a way to make jsdoc work with anonymous functions or to work with my second code?

Thanks in advance.

도움이 되었습니까?

해결책

Use @lends <global> like this:

(/** @lends <global> */ function (){
// etc... the rest remains the same.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top