fix($ionicActionSheet): provide default functions for options

Fixes #1013
This commit is contained in:
Andy Joslin
2014-04-11 09:30:58 -06:00
parent 730a33b9c3
commit ba39fb0046

View File

@@ -71,7 +71,11 @@ function($rootScope, $document, $compile, $animate, $timeout, $ionicTemplateLoad
show: function(opts) {
var scope = $rootScope.$new(true);
angular.extend(scope, opts);
angular.extend(scope, {
cancel: angular.noop,
buttonClicked: angular.noop,
destructiveButtonClicked: angular.noop
}, opts);
// Compile the template
var element = $compile('<ion-action-sheet buttons="buttons"></ion-action-sheet>')(scope);