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

let BaseCtrlInject = ['$uibModalInstance', 'data', 'texts', 'classes', 'btnText'];
export class DialogsBaseCtrl {
    static get $inject(){
        return BaseCtrlInject;
    }
    constructor(...injectables){
        Util.injectNg(injectables, BaseCtrlInject, this)
    }
    close(){
        this.$uibModalInstance.close();
    }
    $onInit(){
        this.msg = this.texts.msg;
        let { icon } = this.classes;
        this.classes.icon = angular.isDefined(icon) && angular.isString(icon) ? icon : 'fas fa-exclamation-triangle';
        this.header = Util.setTranslation(this.texts.header);
    }
}