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.