PageRenderTime 134ms CodeModel.GetById 131ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 3== The @memberOf Tag ==
 4
 5The `@memberOf` tag allows you to document what you consider the "parent" or container of an object to be.
 6
 7=== Syntax ===
 8
 9{{{
10@memberOf parentNamepath
11}}}
12
13  * parentNamepath - Required: the namepath of the containing object.
14
15=== Example ===
16
17{{{
18var Tools = {};
19
20/** @namespace */
21Tools.Dom = {};
22
23/** @memberOf Tools.Dom */
24var hiliteSearchTerm = function(term) {
25}
26
27Tools.Dom.highlightSearchTerm = hiliteSearchTerm;
28}}}
29
30Without 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.
31
32===Note ===
33
34By 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:
35
36{{{
37@memberOf Tools.Dom#
38}}}
39
40or
41
42{{{
43@memberOf Tools.Dom.prototype
44}}}
45
46
47=== In Addition ===
48
49There are two tags that act as if they are combined with `@memberOf`:
50
51  * @methodOf - is a shorter synonym for `@function` plus `@memberOf`
52  * @fieldOf - is a shorter synonym for `@field` plus `@memberOf`
53
54=== See Also ===
55
56  * the [TagName @name] tag.