Ionic - Cara menggunakan Action Sheet
[Image]
Sample Action Sheet
Action Sheet adalah layanan Ionic yang akan memicu geser panel di bagian bawah layar yang dapat Anda gunakan untuk berbagai keperluan.
Berikut Cara pemakainnya :
Tambahkan pada js
.controller('ActionSheetCtrl', function($scope, $ionicActionSheet) {
$scope.triggerActionSheet = function() {
// Show the action sheet
var showActionSheet = $ionicActionSheet.show({
buttons: [
{ text: 'Edit 1' },
{ text: 'Edit 2' }
],
destructiveButtonClicked: function() {
// add delete code..
}
});
};
})
Tambahkan pada view html Anda:
<button class = "button" ng-click="triggerActionSheet()">Action Sheet Button</button>
jangan lupa untuk menambahkan triggerActionSheet() untuk memanggil fungsi yang sudah kita buat diatas.
Show method options
PropertiesTypeDetails
buttonsobjectCreates button object with a text field.
titleTextstringThe title of the action sheet.
cancelTextstringThe text for cancel button.
destructiveTextstringThe text for a destructive button.
cancelfunctionCalled when cancel button, backdrop or hardware back button is pressed.
buttonClickedfunctionCalled when one of the buttons is tapped. Index is used for keeping track of which button is tapped. Return true will close the action sheet.
destructiveButtonClickedfunctionCalled when destructive button is clicked. Return true will close the action sheet.
cancelOnStateChangebooleanIf true (default) it will cancel the action sheet when navigation state is changed.
posted by Brillian Musyafa at 2:43 AM on Apr 3, 2016
"Ionic - Cara menggunakan Action Sheet"
No comments yet. -