import { ModalDirective } from 'ngx-bootstrap/modal'
import { ConfirmService } from './confirm.service'
+import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({
selector: 'my-confirm',
inputLabel = ''
inputValue = ''
+ confirmButtonText = ''
- constructor (private confirmService: ConfirmService) {
+ constructor (
+ private confirmService: ConfirmService,
+ private i18n: I18n
+ ) {
// Empty
}
}
this.confirmService.showConfirm.subscribe(
- ({ title, message, expectedInputValue, inputLabel }) => {
+ ({ title, message, expectedInputValue, inputLabel, confirmButtonText }) => {
this.title = title
this.message = message
this.inputLabel = inputLabel
this.expectedInputValue = expectedInputValue
+ this.confirmButtonText = confirmButtonText || this.i18n('Confirm')
+
this.showModal()
}
)