/wiki/TagMemberOf.wiki

http://jsdoc-toolkit.googlecode.com/ · Unknown · 56 lines · 34 code · 22 blank · 0 comment · 0 complexity · 4115a22de664feb9eb72892fc0af4618 MD5 · raw file

  1. #summary @memberOf
  2. == The @memberOf Tag ==
  3. The `@memberOf` tag allows you to document what you consider the "parent" or container of an object to be.
  4. === Syntax ===
  5. {{{
  6. @memberOf parentNamepath
  7. }}}
  8. * parentNamepath - Required: the namepath of the containing object.
  9. === Example ===
  10. {{{
  11. var Tools = {};
  12. /** @namespace */
  13. Tools.Dom = {};
  14. /** @memberOf Tools.Dom */
  15. var hiliteSearchTerm = function(term) {
  16. }
  17. Tools.Dom.highlightSearchTerm = hiliteSearchTerm;
  18. }}}
  19. Without the `@memberOf` tag, the `hiliteSearchTerm` function would be documented as a global function. That's because, in fact, it is a global function, but it is also a member of the `Tools.Dom` namespace as well, and that's how you wish to document it.
  20. ===Note ===
  21. By default, as in the above example, the member is documented as static. If you want to document a member as belonging to an instance, or to the prototype, adjust the namespace like so:
  22. {{{
  23. @memberOf Tools.Dom#
  24. }}}
  25. or
  26. {{{
  27. @memberOf Tools.Dom.prototype
  28. }}}
  29. === In Addition ===
  30. There are two tags that act as if they are combined with `@memberOf`:
  31. * @methodOf - is a shorter synonym for `@function` plus `@memberOf`
  32. * @fieldOf - is a shorter synonym for `@field` plus `@memberOf`
  33. === See Also ===
  34. * the [TagName @name] tag.