From 54c95ce9183777249edb7fda3ef1355b117fe2ca Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Wed, 9 Dec 2015 14:47:02 -0600 Subject: [PATCH] docs(demos/popup): api demo --- demos/popup/app.html | 2 ++ demos/popup/index.ts | 53 +++++++++++++++++++++++++++++++++++++++++++ demos/popup/main.html | 9 ++++++++ 3 files changed, 64 insertions(+) create mode 100644 demos/popup/app.html create mode 100644 demos/popup/index.ts create mode 100644 demos/popup/main.html diff --git a/demos/popup/app.html b/demos/popup/app.html new file mode 100644 index 0000000000..5f6bb33d68 --- /dev/null +++ b/demos/popup/app.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/demos/popup/index.ts b/demos/popup/index.ts new file mode 100644 index 0000000000..594001c883 --- /dev/null +++ b/demos/popup/index.ts @@ -0,0 +1,53 @@ +import {App, Page, IonicApp, Config, Platform} from 'ionic/ionic'; +import {Popup} from 'ionic/ionic'; + +@App({ + templateUrl: 'app.html' +}) +class ApiDemoApp { + + constructor() { + this.rootPage = InitialPage; + } +} + +@Page({ + templateUrl: 'main.html' +}) +export class InitialPage { + constructor(popup: Popup) { + this.popup = popup; + this.confirmOpen = false; + this.confirmResult = ''; + } + + doAlert() { + this.popup.alert({ + title: "New Friend!", + template: "Your friend, Obi wan Kenobi, just accepted your friend request!", + cssClass: 'my-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" + }); + } + + doConfirm() { + this.confirmOpen = true; + this.popup.confirm({ + title: "Use this lightsaber?", + subTitle: "You can't exchange lightsabers", + template: "Do you agree to use this lightsaber to do good across the intergalactic galaxy?", + cancelText: "Disagree", + okText: "Agree" + }); + } + +} + diff --git a/demos/popup/main.html b/demos/popup/main.html new file mode 100644 index 0000000000..94db96fefd --- /dev/null +++ b/demos/popup/main.html @@ -0,0 +1,9 @@ + + Popup + + + + + + +