UNPKG

ngx-bootstrap-confirm

Version:

Bootstrap confirm provider for Angular 11+

2 lines 2.03 kB
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/core"),require("ngx-bootstrap/modal"),require("rxjs")):"function"==typeof define&&define.amd?define("ngx-bootstrap-confirm",["exports","@angular/core","ngx-bootstrap/modal","rxjs"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self)["ngx-bootstrap-confirm"]={},e.ng.core,e.modal,e.rxjs)}(this,(function(e,o,t,n){"use strict";var r=function(){function e(e){this.bsModalRef=e}return e.prototype.ngOnInit=function(){this.onClose=new n.Subject},e.prototype.confirm=function(){this.onClose.next(!0),this.bsModalRef.hide()},e.prototype.decline=function(){this.onClose.next(!1),this.bsModalRef.hide()},e}();r.decorators=[{type:o.Component,args:[{selector:"lib-ngx-bootstrap-confirm",template:'\n <div class="confirm modal-body">\n <div class="content" [innerHTML]="title"></div>\n <div class="buttons">\n <button type="button" class="btn btn-success" (click)="confirm()" [innerHTML]="confirmLabel"></button>\n <button type="button" class="btn btn-danger" (click)="decline()" [innerHTML]="declineLabel"></button>\n </div>\n </div>\n '}]}],r.ctorParameters=function(){return[{type:t.BsModalRef}]};var i=function(){function e(e){this.modalService=e}return e.prototype.confirm=function(e){var o=this;return new Promise((function(t,n){o.modalRef=o.modalService.show(r),o.modalRef.content.title=e.title,o.modalRef.content.confirmLabel=e.confirmLabel,o.modalRef.content.declineLabel=e.declineLabel,o.modalRef.content.onClose.subscribe((function(e){t(e)}))}))},e}();i.decorators=[{type:o.Injectable}],i.ctorParameters=function(){return[{type:t.BsModalService}]};var s=function(){};s.decorators=[{type:o.NgModule,args:[{declarations:[r],imports:[t.ModalModule.forRoot()],exports:[r],providers:[i]}]}],e.NgxBootstrapConfirmComponent=r,e.NgxBootstrapConfirmModule=s,e.NgxBootstrapConfirmService=i,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=ngx-bootstrap-confirm.umd.min.js.map