mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-28 08:16:22 +02:00
29 lines
949 B
JavaScript
29 lines
949 B
JavaScript
angular.module('rallly')
|
|
.factory('ConfirmModal', function(btfModal){
|
|
|
|
return function(config){
|
|
var modal;
|
|
modal = btfModal({
|
|
templateUrl : 'templates/confirmmodal.html',
|
|
controllerAs : 'modal',
|
|
controller : function(){
|
|
this.title = config.title
|
|
this.message = config.message;
|
|
this.confirm = function(){
|
|
if (config.confirm) config.confirm();
|
|
modal.deactivate();
|
|
}
|
|
this.cancel = modal.deactivate;
|
|
this.confirmText = config.confirmText || 'Confirm';
|
|
this.cancelText = config.cancelText || 'Cancel';
|
|
this.isDestructive = config.isDestructive;
|
|
}
|
|
});
|
|
this.show = function(){
|
|
modal.activate();
|
|
}
|
|
this.destroy = function(){
|
|
modal.deactivate();
|
|
}
|
|
}
|
|
});
|