diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/command-modal/command-modal.component.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/command-modal/command-modal.component.ts index 4ef50b3..84c892e 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/command-modal/command-modal.component.ts +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/command-modal/command-modal.component.ts @@ -42,7 +42,6 @@ export class CommandModalComponent implements OnInit, OnDestroy { } attemptSave() { - debugger; this.loading = true; this.dataSource.executeCommandByName(this.command, this.commandModel) .pipe( diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/directives/command-modal.directive.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/directives/command-modal.directive.ts index 78149f5..4fccfe5 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/directives/command-modal.directive.ts +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/directives/command-modal.directive.ts @@ -20,13 +20,14 @@ export class CommandModalDirective { @Input() commandText: string; @Input() cancelText: string; @Input() animated: boolean; + @Input() isConfirmModal: boolean; @HostListener('click') wasClicked() { this.dataSource.resolveCommandModelByName({ command: this.command, model: this.model - }).subscribe(commandModel => { + }).subscribe(commandModel => { const initialState = { dataSource: this.dataSource, command: this.command, @@ -37,6 +38,12 @@ export class CommandModalDirective { commandText: this.commandText || 'OK', cancelText: this.cancelText || 'Cancel' }; + if(this.isConfirmModal){ + this.modalService.show(CommandModalComponent, { + animated: this.animated === undefined ? true : this.animated, + initialState + }); + } this.modalService.show(CommandModalComponent, { animated: this.animated === undefined ? true : this.animated, initialState diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/form-group-command-modal/form-group-command-modal/form-group-command-modal.component.html b/projects/poweredsoft/ngx-bootstrap/src/lib/form-group-command-modal/form-group-command-modal/form-group-command-modal.component.html index a509523..4642185 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/lib/form-group-command-modal/form-group-command-modal/form-group-command-modal.component.html +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/form-group-command-modal/form-group-command-modal/form-group-command-modal.component.html @@ -21,7 +21,7 @@