{"action":"created","issue":{"url":"https://api.github.com/repos/jsdoc3/jsdoc/issues/28","repository_url":"https://api.github.com/repos/jsdoc3/jsdoc","labels_url":"https://api.github.com/repos/jsdoc3/jsdoc/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/jsdoc3/jsdoc/issues/28/comments","events_url":"https://api.github.com/repos/jsdoc3/jsdoc/issues/28/events","html_url":"https://github.com/jsdoc3/jsdoc/issues/28","id":1568808,"number":28,"title":"How to document var self = this;","user":{"login":"tomalec","id":17435,"avatar_url":"https://avatars.githubusercontent.com/u/17435?v=3","gravatar_id":"","url":"https://api.github.com/users/tomalec","html_url":"https://github.com/tomalec","followers_url":"https://api.github.com/users/tomalec/followers","following_url":"https://api.github.com/users/tomalec/following{/other_user}","gists_url":"https://api.github.com/users/tomalec/gists{/gist_id}","starred_url":"https://api.github.com/users/tomalec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomalec/subscriptions","organizations_url":"https://api.github.com/users/tomalec/orgs","repos_url":"https://api.github.com/users/tomalec/repos","events_url":"https://api.github.com/users/tomalec/events{/privacy}","received_events_url":"https://api.github.com/users/tomalec/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2011-09-05T14:15:55Z","updated_at":"2016-03-30T14:24:04Z","closed_at":"2011-09-05T18:50:31Z","body":"Hi,\r\nIs there any nice way to get all self.methods and properties documented?\r\n\r\n\r\n```javascript       \r\n/** @class*/\r\n\tvar myClass = function() {\r\n\t\t/** Document me. */\r\n\t\tthis.method = function() {};\r\n\r\n\t\tvar self = this;\r\n\t\t/** Document me. */\r\n\t\tself.anotherMethod = function() {};\r\n\t\t/** Document me. */\r\n\t\tself.prop= 1;\r\n\r\n\t};\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jsdoc3/jsdoc/issues/comments/203456033","html_url":"https://github.com/jsdoc3/jsdoc/issues/28#issuecomment-203456033","issue_url":"https://api.github.com/repos/jsdoc3/jsdoc/issues/28","id":203456033,"user":{"login":"kenbellows","id":657118,"avatar_url":"https://avatars.githubusercontent.com/u/657118?v=3","gravatar_id":"","url":"https://api.github.com/users/kenbellows","html_url":"https://github.com/kenbellows","followers_url":"https://api.github.com/users/kenbellows/followers","following_url":"https://api.github.com/users/kenbellows/following{/other_user}","gists_url":"https://api.github.com/users/kenbellows/gists{/gist_id}","starred_url":"https://api.github.com/users/kenbellows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenbellows/subscriptions","organizations_url":"https://api.github.com/users/kenbellows/orgs","repos_url":"https://api.github.com/users/kenbellows/repos","events_url":"https://api.github.com/users/kenbellows/events{/privacy}","received_events_url":"https://api.github.com/users/kenbellows/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T14:24:04Z","updated_at":"2016-03-30T14:24:04Z","body":"For posterity, a quick way to solve this problem is to alias `self` to the class name:\r\n\r\n```\r\n/** @class myClass */\r\nvar myClass = function() {\r\n    /** Document me. */\r\n    this.method = function() {};\r\n    \r\n    /** @alias myClass */\r\n    var self = this;\r\n\r\n    /** Document me. */\r\n    self.anotherMethod = function() {};\r\n\r\n    /** Document me. */\r\n    self.prop= 1;\r\n\r\n};\r\n```\r\n\r\nI've tested this with JSDoc 3.4.0, not sure about earlier versions but I don't see why it wouldn't work the same. I've tested it with classes and modules and it works fine in both cases."}}