From 03e13b5505693131ed68d5965bde03854341acbc Mon Sep 17 00:00:00 2001 From: mhartington Date: Tue, 5 Jan 2016 16:06:40 -0500 Subject: [PATCH] docs(alert) --- demos/component-docs/alerts/basic/pages.ts | 73 ++++++++++++++----- .../component-docs/alerts/basic/template.html | 4 +- 2 files changed, 55 insertions(+), 22 deletions(-) diff --git a/demos/component-docs/alerts/basic/pages.ts b/demos/component-docs/alerts/basic/pages.ts index ed70fd2393..f932a49cde 100644 --- a/demos/component-docs/alerts/basic/pages.ts +++ b/demos/component-docs/alerts/basic/pages.ts @@ -4,8 +4,8 @@ import {forwardRef} from 'angular2/core'; @Page({ - templateUrl: 'alerts/basic/template.html', - directives: [forwardRef(() => AndroidAttribute)] + templateUrl: 'alerts/basic/template.html', + directives: [forwardRef(() => AndroidAttribute)] }) export class BasicPage { @@ -15,30 +15,63 @@ export class BasicPage { doAlert() { let alert = Alert.create({ - title: "New Friend!", - subTitle: "Your friend, Obi wan Kenobi, just accepted your friend request!", + title: 'New Friend!', + subTitle: 'Your friend, Obi wan Kenobi, just accepted your friend request!', buttons: ['Ok'] }); this.nav.present(alert); } - // doPrompt() { - // this.popup.prompt({ - // title: "New Album", - // template: "Enter a name for this new album you're so keen on adding", - // inputPlaceholder: "Title", - // okText: "Save" - // }); - // } + doPrompt() { + Baasbox Javascript SDK + let prompt = Alert.create({ + title: 'Login', + body: "Enter a name for this new album you're so keen on adding", + inputs: [ + { + name: 'title', + placeholder: 'Title' + }, + ], + buttons: [ + { + text: 'Cancel', + handler: data => { + console.log('Cancel clicked'); + } + }, + { + text: 'Save', + handler: data => { + console.log('Saved clicked'); + } + } + ] + }); + this.nav.present(prompt); + } - // doConfirm() { - // this.popup.confirm({ - // title: "Use this lightsaber?", - // template: "Do you agree to use this lightsaber to do good across the intergalactic galaxy?", - // cancelText: "Disagree", - // okText: "Agree" - // }); - // } + doConfirm() { + let confirm = Alert.create({ + title: 'Use this lightsaber?', + body: 'Do you agree to use this lightsaber to do good across the intergalactic galaxy?', + buttons: [ + { + text: 'Disagree', + handler: () => { + console.log('Disagree clicked'); + } + }, + { + text: 'Agree', + handler: () => { + console.log('Agree clicked'); + } + } + ] + }); + this.nav.present(confirm); + } // onPageWillLeave() { // let popup = this.popup.get(); diff --git a/demos/component-docs/alerts/basic/template.html b/demos/component-docs/alerts/basic/template.html index 9a7f0cc525..771bec071d 100644 --- a/demos/component-docs/alerts/basic/template.html +++ b/demos/component-docs/alerts/basic/template.html @@ -5,6 +5,6 @@ - + +