Latest web development tutorials

ionic pop-up menu (ActionSheet)

Pop-up menu (ActionSheet) through pop-up box to allow users to select an option.

Very dangerous option will be highlighted in red for the first time to identify people. You can click the Cancel button or click a blank place to make it disappear.


HTML code

<body ng-app="starter" ng-controller="actionsheetCtl" >

        <ion-content >
            <h2 ng-click="show()">Action Sheet</h2>

JavaScript code

Trigger pop-up menu in the code, you need to use $ ionicActionSheet service in your angular controller:

angular.module('starter', ['ionic'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
    if(window.StatusBar) {

.controller( 'actionsheetCtl',['$scope','$ionicActionSheet','$timeout' ,function($scope,$ionicActionSheet,$timeout){
    $ = function() {

        var hideSheet = ${
            buttons: [
              { text: '<b>Share</b> This' },
              { text: 'Move' }
            destructiveText: 'Delete',
            titleText: 'Modify your album',
            cancelText: 'Cancel',
            cancel: function() {
                 // add cancel code..
            buttonClicked: function(index) {
              return true;

        $timeout(function() {
        }, 2000);


Operating results as follows: