/* * We don't document the ionActionSheet directive, we instead document * the $ionicActionSheet service */ IonicModule .directive('ionActionSheet', ['$document', function($document) { return { restrict: 'E', scope: true, replace: true, link: function($scope, $element) { var keyUp = function(e) { if (e.which == 27) { $scope.cancel(); $scope.$apply(); } }; var backdropClick = function(e) { if (e.target == $element[0]) { $scope.cancel(); $scope.$apply(); } }; $scope.$on('$destroy', function() { $element.remove(); $document.unbind('keyup', keyUp); }); $document.bind('keyup', keyUp); $element.bind('click', backdropClick); }, template: '
' + '
' + '
' + '
' + '
' + '' + '' + '
' + '
' + '' + '
' + '
' + '
' + '
' }; }]);