From 7b665490d9a12d38adb38679de3c0acc83ad5324 Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Wed, 9 Dec 2015 10:06:19 -0600 Subject: [PATCH 1/6] docs(demos/actionSheet): actionSheet api demo --- demos/action-sheet/app.html | 2 ++ demos/action-sheet/index.ts | 38 +++++++++++++++++++++++------------- demos/action-sheet/main.html | 10 ++++++++-- 3 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 demos/action-sheet/app.html diff --git a/demos/action-sheet/app.html b/demos/action-sheet/app.html new file mode 100644 index 0000000000..5f6bb33d68 --- /dev/null +++ b/demos/action-sheet/app.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/demos/action-sheet/index.ts b/demos/action-sheet/index.ts index 5775b714b8..829799ce6b 100644 --- a/demos/action-sheet/index.ts +++ b/demos/action-sheet/index.ts @@ -1,41 +1,51 @@ -import {App, ActionSheet} from 'ionic/ionic'; - +import {App, Page, IonicApp, Config, Platform} from 'ionic/ionic'; +import {ActionSheet} from 'ionic/ionic'; @App({ + templateUrl: 'app.html' +}) +class ApiDemoApp { + + constructor() { + this.rootPage = InitialPage; + } +} + +@Page({ templateUrl: 'main.html' }) -class IonicApp { - - constructor(actionSheet: ActionSheet) { +export class InitialPage { + constructor(actionSheet: ActionSheet, platform: Platform) { this.actionSheet = actionSheet; + this.platform = platform; } - openMenu() { + open() { this.actionSheet.open({ buttons: [ - { text: 'Share This' }, - { text: 'Move' } + { text: 'Share'}, + { text: 'Play'}, + { text: 'Favorite'} ], destructiveText: 'Delete', - titleText: 'Modify your album', + titleText: 'Albums', cancelText: 'Cancel', - cancel: function() { + cancel: () => { console.log('Canceled'); }, destructiveButtonClicked: () => { console.log('Destructive clicked'); }, - buttonClicked: function(index) { + buttonClicked: (index) => { console.log('Button clicked', index); - if(index == 1) { return false; } + if (index == 1) { return false; } return true; } }).then(actionSheetRef => { this.actionSheetRef = actionSheetRef; }); - } - } + diff --git a/demos/action-sheet/main.html b/demos/action-sheet/main.html index e22f9e3ca7..58ebcd2cac 100644 --- a/demos/action-sheet/main.html +++ b/demos/action-sheet/main.html @@ -1,3 +1,9 @@ + + Action Sheet + + - - + + + + From d3136549293da334a83a04610c026fe4dd7681b5 Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Wed, 9 Dec 2015 10:15:06 -0600 Subject: [PATCH 2/6] docs(actionSheet): add api demo link --- ionic/components/action-sheet/action-sheet.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ionic/components/action-sheet/action-sheet.ts b/ionic/components/action-sheet/action-sheet.ts index 50203083d7..e57a4861dd 100644 --- a/ionic/components/action-sheet/action-sheet.ts +++ b/ionic/components/action-sheet/action-sheet.ts @@ -107,6 +107,7 @@ class ActionSheetCmp { * } * ``` * + * @demo /docs/v2/demos/action-sheet/ * @see {@link /docs/v2/components#action-sheets ActionSheet Component Docs} */ @Injectable() From 59a3fbe88b5426070059212888a78d01779c5285 Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Wed, 9 Dec 2015 11:06:33 -0600 Subject: [PATCH 3/6] docs(demos/hideWhen): api demo --- demos/hide-when/app.html | 1 + demos/hide-when/index.ts | 20 ++++++++++++++++++++ demos/hide-when/main.html | 9 +++++++++ 3 files changed, 30 insertions(+) create mode 100644 demos/hide-when/app.html create mode 100644 demos/hide-when/index.ts create mode 100644 demos/hide-when/main.html diff --git a/demos/hide-when/app.html b/demos/hide-when/app.html new file mode 100644 index 0000000000..776be9a94a --- /dev/null +++ b/demos/hide-when/app.html @@ -0,0 +1 @@ + diff --git a/demos/hide-when/index.ts b/demos/hide-when/index.ts new file mode 100644 index 0000000000..a1884eb2c1 --- /dev/null +++ b/demos/hide-when/index.ts @@ -0,0 +1,20 @@ +import {App, Page, IonicApp} from 'ionic/ionic'; + +@App({ + templateUrl: 'app.html' +}) +class ApiDemoApp { + + constructor() { + this.rootPage = InitialPage; + } +} + +@Page({ + templateUrl: 'main.html' +}) +export class InitialPage { + constructor() { + } +} + diff --git a/demos/hide-when/main.html b/demos/hide-when/main.html new file mode 100644 index 0000000000..2beb4739eb --- /dev/null +++ b/demos/hide-when/main.html @@ -0,0 +1,9 @@ + + HideWhen + + + +

+ (hide-when="android") This text is hidden on Android only. Click the Android tab to hide this text. +

+ From b7bff56d25708b484658ff3481b8d636b0c5382c Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Wed, 9 Dec 2015 11:19:09 -0600 Subject: [PATCH 4/6] docs(demos/showWhen): api demo --- demos/show-when/app.html | 1 + demos/show-when/index.ts | 20 ++++++++++++++++++++ demos/show-when/main.html | 9 +++++++++ 3 files changed, 30 insertions(+) create mode 100644 demos/show-when/app.html create mode 100644 demos/show-when/index.ts create mode 100644 demos/show-when/main.html diff --git a/demos/show-when/app.html b/demos/show-when/app.html new file mode 100644 index 0000000000..776be9a94a --- /dev/null +++ b/demos/show-when/app.html @@ -0,0 +1 @@ + diff --git a/demos/show-when/index.ts b/demos/show-when/index.ts new file mode 100644 index 0000000000..a1884eb2c1 --- /dev/null +++ b/demos/show-when/index.ts @@ -0,0 +1,20 @@ +import {App, Page, IonicApp} from 'ionic/ionic'; + +@App({ + templateUrl: 'app.html' +}) +class ApiDemoApp { + + constructor() { + this.rootPage = InitialPage; + } +} + +@Page({ + templateUrl: 'main.html' +}) +export class InitialPage { + constructor() { + } +} + diff --git a/demos/show-when/main.html b/demos/show-when/main.html new file mode 100644 index 0000000000..bacd10e446 --- /dev/null +++ b/demos/show-when/main.html @@ -0,0 +1,9 @@ + + ShowWhen + + + +

+ (show-when="ios") This text is shown on iOS only. Click the Android tab to hide this text. +

+ From 95906e921dd98ba0728d2dfb5462de70ba67576b Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Wed, 9 Dec 2015 11:40:24 -0600 Subject: [PATCH 5/6] docs(showHideWhen): update description and usage --- .../components/show-hide-when/show-hide-when.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ionic/components/show-hide-when/show-hide-when.ts b/ionic/components/show-hide-when/show-hide-when.ts index 22827aa989..7786e042fb 100644 --- a/ionic/components/show-hide-when/show-hide-when.ts +++ b/ionic/components/show-hide-when/show-hide-when.ts @@ -53,12 +53,14 @@ class DisplayWhen { /** * - * The `show-when` attribute takes a value or expression, and only shows the element it has been added to when - * the value or expression is true. Complements the [hide-when attribute](../HideWhen). + * The `show-when` attribute takes a string that represents a plaform or screen orientation. + * The element the attribute is added to will only be shown when that platform or screen orientation is active. + * Complements the [hide-when attribute](../HideWhen). * @usage * ```html - *
I am hidden!
+ *
I am only visible on iOS!
* ``` + * @demo /docs/v2/demos/show-when/ */ @Directive({ selector: '[show-when]', @@ -87,12 +89,14 @@ export class ShowWhen extends DisplayWhen { /** * - * The `hide-when` attribute takes a value or expression, and hides the element it has been added to when - * the value or expression is true. Complements the [show-when attribute](../ShowWhen). + * The `hide-when` attribute takes a string that represents a plaform or screen orientation. + * The element the attribute is added to will only be hidden when that platform or screen orientation is active. + * Complements the [show-when attribute](../ShowWhen). * @usage * ```html - *
I am hidden!
+ *
I am hidden on Android!
* ``` + * @demo /docs/v2/demos/hide-when/ */ @Directive({ selector: '[hide-when]', From 12dd6b4f38b6acc40438ada6b8680bd73fc88d2e Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Wed, 9 Dec 2015 11:50:59 -0600 Subject: [PATCH 6/6] docs(showHideWhen): link to related sections --- ionic/components/show-hide-when/show-hide-when.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ionic/components/show-hide-when/show-hide-when.ts b/ionic/components/show-hide-when/show-hide-when.ts index 7786e042fb..3c150bdf25 100644 --- a/ionic/components/show-hide-when/show-hide-when.ts +++ b/ionic/components/show-hide-when/show-hide-when.ts @@ -61,6 +61,7 @@ class DisplayWhen { *
I am only visible on iOS!
* ``` * @demo /docs/v2/demos/show-when/ + * @see {@link ../HideWhen HideWhen API Docs} */ @Directive({ selector: '[show-when]', @@ -97,6 +98,7 @@ export class ShowWhen extends DisplayWhen { *
I am hidden on Android!
* ``` * @demo /docs/v2/demos/hide-when/ + * @see {@link ../ShowWhen ShowWhen API Docs} */ @Directive({ selector: '[hide-when]',