From c340951b48116a2e1120b25892d5741a404ba26f Mon Sep 17 00:00:00 2001 From: Andrew Joslin Date: Thu, 22 May 2014 11:41:28 -0600 Subject: [PATCH] demo($ionicActionSheet): add demo --- js/angular/service/actionSheet.js | 60 +++++++++++++++++++++++++++++++ js/angular/service/popup.js | 5 ++- 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/js/angular/service/actionSheet.js b/js/angular/service/actionSheet.js index 27223c6757..ac7e14b735 100644 --- a/js/angular/service/actionSheet.js +++ b/js/angular/service/actionSheet.js @@ -40,6 +40,66 @@ * ``` * */ + +/** + * @ngdoc demo + * @name $ionicActionSheet#simple + * @module actionSheetSimple + * @javascript + * angular.module('actionSheetSimple', ['ionic']) + * .controller('ActionSheetCtrl', function($scope, $ionicActionSheet) { + * $scope.messages = []; + * $scope.takeAction = function() { + * $ionicActionSheet.show({ + * buttons: [ + * { text: 'Share ' }, + * { text: 'Edit ' } + * ], + * destructiveText: 'Delete ', + * titleText: 'Modify your album', + * cancelText: 'Cancel', + * cancel: function() { + * $scope.message('Cancel'); + * return true; + * }, + * buttonClicked: function(index) { + * $scope.message(index === 0 ? 'Share' : 'Edit'); + * return true; + * }, + * destructiveButtonClicked: function() { + * $scope.message('Delete'); + * return true; + * } + * }); + * }; + * $scope.message = function(msg) { + * $scope.messages.unshift({ + * text: 'User pressed ' + msg + * }); + * }; + * + * }); + * + * @html + * + *

Action

+ *
+ * + *
+ * Take Action! + *
+ *
+ *
+ * User Log + *
+ *
+ *
+ * {{message.text}} + *
+ *
+ *
+ *
+ */ IonicModule .factory('$ionicActionSheet', [ '$rootScope', diff --git a/js/angular/service/popup.js b/js/angular/service/popup.js index 68e8a05af6..c83b5eb587 100644 --- a/js/angular/service/popup.js +++ b/js/angular/service/popup.js @@ -187,6 +187,9 @@ angular.module('popupSimple', ['ionic']) }; }); * @html + +

Popups

+
@@ -194,7 +197,7 @@ angular.module('popupSimple', ['ionic'])