| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- ---
- layout: fluid/docs_base
- version: "<$ version.current.name $>"
- category: storage
- id: "<$ doc.name|lower|replace(' ','-') $>"
- title: "<$ doc.name $> - Ionic Framework"
- ---
-
- <@ macro paramList(paramData) -@>
- <@- if paramData -@><span class="params">(
- <@- for param in paramData -@>
- <span class="param"><$ param | escape $><@ if not loop.last @>, <@ endif @></span>
- <@- endfor @>)</span>
- <@- endif @>
- <@- endmacro -@>
-
- <@ macro returnObject(params) -@>
- <@- if params -@>
- <table class="table returns-object-table param-table">
- <thead>
- <tr>
- <th>Property</th>
- <th>Type</th>
- <th>Details</th>
- </tr>
- </thead>
- <tbody>
- <@ for param in params @>
- <tr>
- <td class="fixed-width">
- <$ param.key $>
- </td>
- <td>
- <$ param.type | code $>
- </td>
- <td>
- <$ param.description | marked $>
- </td>
- </tr>
- <@ endfor @>
- </tbody>
- </table>
- <@- endif @>
- <@- endmacro -@>
-
- <@ macro githubViewLink(doc) -@>
- <a href="https://github.com/<$ versionInfo.gitRepoInfo.owner $>/<$ versionInfo.gitRepoInfo.repo $>/tree/master/<$ doc.fileInfo.relativePath $>#L<$ doc.location.start.line+1 $>-L<$ doc.location.end.line+1 $>"><$ doc.fileInfo.relativePath $> (line <$ doc.location.start.line+1 $>)</a>
- <@- endmacro -@>
-
- <@ macro paramTable(params, isDirective) -@>
- <table class="table param-table" style="margin:0;">
- <thead>
- <tr>
- <th><@ if isDirective @>Attr<@ else @>Param<@ endif @></th>
- <th>Type</th>
- <th>Details</th>
- </tr>
- </thead>
- <tbody>
- <@ for param in params @>
- <tr>
- <td>
- <$ param.name $>
- <@ if param.alias @>| <$ param.alias $><@ endif @>
- <@ if param.type.optional @><div><em>(optional)</em></div><@ endif @>
- </td>
- <td>
- <$ typeList(param.typeList) $>
- </td>
- <td>
- <$ param.description | marked $>
- <@ if param.default @><p><em>(default: <$ param.default $>)</em></p><@ endif @>
- </td>
- </tr>
- <@ endfor @>
- </tbody>
- </table>
- <@- endmacro -@>
-
- <@ macro inputTable(params, isDirective) -@>
- <table class="table param-table" style="margin:0;">
- <thead>
- <tr>
- <th>Attr</th>
- <th>Type</th>
- <th>Details</th>
- </tr>
- </thead>
- <tbody>
- <@ for param in params @>
- <tr>
- <td><$ param.name $></td>
- <td><code><$ param.type $></code></td>
- <td><$ param.description | marked $></td>
- </tr>
- <@ endfor @>
- </tbody>
- </table>
- <@- endmacro -@>
-
- <@ macro outputTable(params, isDirective) -@>
- <table class="table param-table" style="margin:0;">
- <thead>
- <tr>
- <th>Attr</th>
- <th>Details</th>
- </tr>
- </thead>
- <tbody>
- <@ for param in params @>
- <tr>
- <td><$ param.name $></td>
- <td><$ param.description | marked $></td>
- </tr>
- <@ endfor @>
- </tbody>
- </table>
- <@- endmacro -@>
-
- <@- macro functionSyntax(fn) @>
- <@- set sep = joiner(', ') -@>
- <code><$ fn.name $><@- if not fn.isProperty @>(<@ endif -@><@- for param in fn.params @><$ sep() $>
- <@- if param.type.optional @>[<@ endif -@>
- <$ param.name $>
- <@- if param.type.optional @>]<@ endif -@>
- <@ endfor @><@- if not fn.isProperty @>)<@ endif -@></code>
- <@ if fn.alias @><small>(alias: <$ fn.alias $>)</small><@ endif @>
- <@ endmacro -@>
-
- <@ macro typeList(types) -@>
- <@ set separator = joiner("|") @>
- <@ for type in types @><$ separator() $><$ type | code $><@ endfor @>
- <@- endmacro -@>
-
- <@- macro typeInfo(fn) -@>
- <$ typeList(fn.typeList) $> <$ fn.description | marked $>
- <@- endmacro -@>
-
- <@ block body @>
- <@ block content @>
- <@ block header @>
-
- <h1 class="api-title">
- <a class="anchor" name="<$ doc.name | dashCase $>" href="#<$ doc.name | dashCase $>"></a>
- <@ if doc.docType == "directive" @>
- <$ doc.name | dashCase $>
- <@ else @>
- <$ doc.name $>
- <@- if doc.directiveInfo @>
- <h3><code><$ doc.directiveInfo.properties[0].values $></code></h3>
- <@ endif -@>
- <@ endif @>
-
- <@ if doc.parent @>
- <br />
- <small>
- Child of <$ doc.parent $>
- </small>
- <@ endif @>
-
- <@ if doc.delegate @>
- <br/>
- <small>
- Delegate: <$ doc.delegate $>
- </small>
- <@ endif @>
- </h1>
-
- <a class="improve-docs" href="http://github.com/ionic-team/ionic/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
- Improve this doc
- </a>
- <@ endblock @>
-
- <@ block description @>
- <$ doc.description | marked $>
- <@ endblock @>
-
- <!-- @usage tag -->
- <@ if doc.usage @>
- <h2><a class="anchor" name="usage" href="#usage"></a>Usage</h2>
- <@ block usage @>
- <$ doc.usage | marked $>
- <@ endblock @>
- <@ endif @>
-
- <!-- @property tags -->
- <@ if doc.properties @>
- <h2><a class="anchor" name="attributes" href="#attributes"></a>Attributes:</h2>
- <table class="table" style="margin:0;">
- <thead>
- <tr>
- <th>Attribute</th>
-
- <@ set hasTypes = false @>
- <@ for prop in doc.properties @>
- <@ if prop.type @>
- <@ set hasTypes = true @>
- <@ endif @>
- <@ endfor @>
- <@ if hasTypes @>
- <th>Type</th>
- <@ endif @>
-
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <@ for prop in doc.properties @>
- <tr>
- <td>
- <$ prop.name $>
- </td>
-
- <@ if hasTypes @>
- <td>
- <$ prop.type.name $>
- </td>
- <@ endif @>
-
- <td>
- <$ prop.description $>
- </td>
- </tr>
- <@ endfor @>
- </tbody>
- </table>
- <@ endif @>
-
- <@- if doc.statics.length -@>
- <h2><a class="anchor" name="static-members" href="#static-members"></a>Static Members</h2>
- <@- for method in doc.statics @><@ if not method.internal @>
- <div id="<$ method.name $>"></div>
- <h3><a class="anchor" name="<$ method.name $>" href="#<$ method.name $>"></a><$ functionSyntax(method) $></h3>
- <$ method.description $>
- <@ if method.params @><$ paramTable(method.params) $><@ endif @>
- <@ if method.this @><h4> Method's `this` <$ method.this $></h4><@ endif @>
- <@ if method.returns @>
- <div class="anchor" class="return-value">
- <b>Returns:</b> <$ typeInfo(method.returns) $>
- <@ if method.returnsObjectParams @>
- <$ returnObject(method.returnsObjectParams) $>
- <@ endif @>
- </div>
- <@ endif @>
- <@ endif @>
- <@ endfor -@>
- <@ endif @>
-
- <!-- instance methods on the class -->
- <@- if doc.members and doc.members.length @>
- <h2><a class="anchor" name="instance-members" href="#instance-members"></a>Instance Members</h2>
- <@- for method in doc.members @>
- <div id="<$ method.name $>"></div>
- <h3><a class="anchor" name="<$ method.name $>" href="#<$ method.name $>"></a><$ functionSyntax(method) $></h3>
- <$ method.description $>
- <@ if method.params @><$ paramTable(method.params) $><@ endif @>
- <@ if method.this @>
- <h4> Method's `this` <$ method.this $></h4>
- <@ endif @>
- <@ if method.returns @>
- <div class="return-value">
- <b>Returns:</b> <$ typeInfo(method.returns) $>
- <@ if method.returnsObjectParams @>
- <$ returnObject(method.returnsObjectParams) $>
- <@ endif @>
- </div>
- <@ endif @>
- <@ endfor -@>
- <@- endif -@>
-
- <@- if doc.inputs and doc.inputs.length @>
- <!-- input methods on the class -->
- <h2><a class="anchor" name="input-properties" href="#input-properties"></a>Input Properties</h2>
- <$ inputTable(doc.inputs) $>
- <@- endif -@>
-
- <@- if doc.outputs and doc.outputs.length @>
- <!-- output events on the class -->
- <h2><a class="anchor" name="output-events" href="#output-events"></a>Output Events</h2>
- <$ outputTable(doc.outputs) $>
- <@- endif -@>
-
- <@ block advanced @>
- <@- if doc.advanced -@>
- <h2><a class="anchor" name="advanced" href="#advanced"></a>Advanced</h2>
- <$ doc.advanced | marked $>
- <@- endif -@>
- <@ endblock @>
-
- <!-- related link -->
- <@- if doc.see @>
- <h2><a class="anchor" name="related" href="#related"></a>Related</h2>
- <@ for s in doc.see @>
- <$ s | safe $> <@- if not loop.last @>,<@- endif -@>
- <@- endfor -@>
- <@- endif -@>
-
- <!-- end content block -->
- <@ endblock @>
-
- <!-- end body block -->
- <@ endblock @>
|