import { Util } from '../util/Util';

let ConfirmCtrlInject = ['$uibModalInstance', 'texts', 'data', 'classes'];
export class DialogsConfirmCtrl {
    static get $inject(){
        return ConfirmCtrlInject;
    }
    constructor(...injectables){
        Util.injectNg(injectables, ConfirmCtrlInject, this);
    }
    $onInit(){
        this.msg = this.texts.msg;
        let { icon } = this.classes;
        this.classes.icon = angular.isDefined(icon) && angular.isString(icon) ? icon : 'fas fa-question-circle';
        this.header = Util.setTranslation(this.texts.header);
    }
    no(){
        this.$uibModalInstance.dismiss('no');
    }
    yes(){
        this.$uibModalInstance.close('yes');
    }
}