--- layout: "fluid/docs_base" version: "<$ version.current.name $>" versionHref: "<$ version.current.href.replace('content/','') $>" path: "<$ doc.path $>" category: native id: "<$ doc.name|lower|replace(' ','-') $>" title: "<@ if doc.docType == "directive" @><$ doc.name | dashCase $><@ else @><$ doc.name $><@ endif @>" header_sub_title: "<$ doc.docType | capital $> in module <$ doc.module $>" doc: "<$ doc.name $>" docType: "<$ doc.docType $>" --- <@- macro interfaceTable(interface) -@> <@ for export in doc.moduleDoc.exports -@> <@ if export.name == interface @>

Param | Type | Details
--- | --- | ---
<@ for param in export.members @>
<$ param.name $> | `<$ param.returnType | escape $>` | <$ param.description | marked $> <@ if param.optional @>(optional)<@ endif @>
<@ endfor @>

<@ endif @> <@- endfor @> <@- endmacro -@> <@- macro githubViewLink(doc) -@> <$ doc.fileInfo.relativePath $> (line <$ doc.location.start.line+1 $>) <@- endmacro -@> <@- macro paramTable(params, isDirective) -@>

<@ if isDirective @>Attr<@ else @>Param<@ endif @> | Type | Details
--- | --- | ---
<@- for param in params @>
<$ param.name $> <@- if param.alias @>| <$ param.alias $><@ endif -@> | <$ typeList(param.typeList) $> | <$ param.description | marked $> <@- if param.defaultValue @> (default: <$ param.defaultValue $>) <@ endif -@>
<@ endfor -@>

<@- endmacro -@> <@- macro functionSyntax(fn) @> <@- set sep = joiner(', ') -@> `<$ 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 -@>` <@- endmacro -@> <@- macro typeList(types) -@> <@ set separator = joiner("|") @> <@- for type in types @><$ separator() $><$ type | code $><@ endfor -@> <@- endmacro -@> <@- macro typeInfo(fn) -@> <$ typeList(fn.typeList) $> <$ fn.description $> <@- endmacro -@> <@- macro documentPlatforms(method) -@> <@- if method.decorators @> <@ for prop in method.decorators[0].argumentInfo @> <@ if prop.platforms @>

Platforms: <@- for platform in prop.platforms -@> <$ platform $> <@- endfor -@>

<@ endif @> <@ endfor @> <@- endif @> <@- endmacro -@> <@ macro documentMethod(method) -@>

### <$ functionSyntax(method) $>

<$ documentPlatforms(method) $> <$ method.description $> <@ if method.params -@> <$ paramTable(method.params) $> <@- endif @> <@ if method.returns -@>
Returns: <$ typeInfo(method.returns) $>
<@- endif @> <@- endmacro -@> <@- macro documentClass(doc) @> <@- if doc.statics.length -@>

## Static Members

<@ for method in doc.statics -@> <$ documentMethod(method) $> <@ endfor -@> <@ endif @> <# --- methods in class --- #> <@- if doc.members and doc.members.length @>

## Instance Members

<@ for method in doc.members -@> <$ documentMethod(method) $> <@- endfor @> <@- endif -@> <@ endmacro @>

# <$ doc.name $> <@- if doc.beta == true -@> β <@- endif -@> <@- if doc.paid == true -@> Paid <@- endif -@>

Improve this doc <# --- Decorators --- #> <@- if doc.decorators @> <@ for prop in doc.decorators[0].argumentInfo @> <@ if doc.beta == true @>

This plugin is still in beta stage and may not work as expected. Please submit any issues to the plugin repo.

<@ endif @> <@ if doc.paid == true @>

This plugin might require a paid license, or might take a share of your app's earnings. Check the plugin's repo for more information.

<@ endif @> <# --- Plugin description --- #> <$ doc.description | marked $>

Repo: <$ prop.repo $>

<# --- Install commands --- #>

## Installation

1. Install the Cordova and Ionic Native plugins:

       $ <@ if prop.install @><$ prop.install | replace('<', '<').replace('>', '>') $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
       $ npm install @ionic-native/<$ doc.npmId $>

2. Add this plugin to your app's module

<# --- Plugin supported platforms --- #> <@ if prop.platforms @>

## Supported platforms

<@ for platform in prop.platforms -@>
- <$ platform $>
<@- endfor @>

<@ endif @> <@ endfor @> <@ endif -@> <# --- end of: if doc.decorators --- #> <# --- Plugin usage --- #> <@ if doc.usage @>

## Usage

<$ doc.usage | marked $> <@ endif @> <# --- Plugin attributes --- #> <@- if doc.properties -@>

## Attributes:

<@ set hasTypes = false @> <@ for prop in doc.properties @> <@ if prop.type @> <@ set hasTypes = true @> <@ endif @> <@ endfor @> <@ if hasTypes @>
<@ endif @>
Attribute | Type | Description
--- | --- | ---
<@- for prop in doc.properties -@>
<@ if hasTypes @>
<@ endif @>
<$ prop.name $> | <$ prop.type.name $> | <$ prop.description $>
<@ endfor -@>

<@- endif -@> <# --- Plugin class documentation --- #> <$ documentClass(doc) $> <# --- Advanced usage --- #> <@- if doc.advanced -@>

## Advanced

<$ doc.advanced | marked $> <@- endif -@> <# --- Other classes --- #> <@- for tag in doc.tags.tags -@> <@- if tag.tagName == 'classes' -@> <@- set classes = tag.description.split('\n') -@> <@- for item in classes -@> <@- if item.length > 1 -@> <@- for export in doc.moduleDoc.exports -@> <@- if export.name == item -@>

## <$ item $>

<$ documentClass(export) $> <@- endif -@> <@- endfor -@> <@- endif -@> <@- endfor -@> <@- endif -@> <@- endfor -@> <# --- Other interfaces --- #> <@ for tag in doc.tags.tags -@> <@ if tag.tagName == 'interfaces' @> <@ set interfaces = tag.description.split('\n') @> <@ for item in interfaces -@> <@ if item.length > 1 @>

## <$ item $>

<$ interfaceTable(item) $> <@ endif @> <@- endfor @> <@ endif @> <@- endfor @> <# --- Related links --- #> <@- if doc.see @>

## Related

<@ for s in doc.see @> <$ s | safe $> <@- endfor -@> <@- endif -@>