From d94ea354a8be1439b329f4e5894b3945fdd0adde Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 28 Sep 2015 11:50:47 -0500 Subject: [PATCH] Docs --- ionic/platform/applinks/applinks.ts | 4 +++- ionic/platform/barcode/barcode.ts | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ionic/platform/applinks/applinks.ts b/ionic/platform/applinks/applinks.ts index 5a47458e11..80440cf9fc 100644 --- a/ionic/platform/applinks/applinks.ts +++ b/ionic/platform/applinks/applinks.ts @@ -7,8 +7,9 @@ import {NativePlugin} from '../plugin'; * Open installed apps on the device. Note: Android and iOS have different ways of * opening and specifying launch params, so they have separate launch functions. * - * Example: + * @usage * + * ```js * if(platform.is('ios') { * AppLinks.check('twitter://').then((installed) => { * AppLinks.openIOS('twitter://user?screen_name=ionicframework') @@ -20,6 +21,7 @@ import {NativePlugin} from '../plugin'; * AppLinks.openAndroid([["action", "VIEW"], ['twitter://user?screen_name=ionicframework']]) * }) * } + * ``` */ @NativePlugin({ name: 'AppLinks', diff --git a/ionic/platform/barcode/barcode.ts b/ionic/platform/barcode/barcode.ts index 947769cc3e..e628af95aa 100644 --- a/ionic/platform/barcode/barcode.ts +++ b/ionic/platform/barcode/barcode.ts @@ -3,6 +3,26 @@ import * as Rx from 'rx'; import * as util from 'ionic/util'; import {NativePlugin} from '../plugin'; +/** + * Scan barcodes and QR codes. + * + * @usage + * + * ## Scanning a code + * + * ```js + * Barcode.scan().then((data) => { + * console.log("Result: " + result.text + "\n" + "Format: " + result.format + "\n" + "Cancelled: " + result.cancelled); + * }, (err) => { + * }) + * ``` + * + * ## Encoding data + * + * ```js + * Barcode.encode(Barcode.TEXT_TYPE).then((data) => {}, (fail) => {}); + * ``` + */ @NativePlugin({ name: 'Barcode', platforms: ['ios', 'android'],