add btnClass to command-modal

This commit is contained in:
Yubing325
2020-07-09 14:28:55 -05:00
parent f702608640
commit fcc39e9fac
5 changed files with 27 additions and 8 deletions
@@ -12,7 +12,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-light" (click)="modalRef.hide()"
[disabled]="loading">{{ cancelText }}</button>
<button type="button" class="btn btn-primary" [disabled]="loading" (click)="onSubmit()">{{ commandText }}</button>
<button type="button" class="btn btn-{{btnClass}}" [disabled]="loading" (click)="onSubmit()">{{ commandText }}</button>
<br>
<div class="progress" style="width: 100%" *ngIf="loading">
@@ -23,7 +23,7 @@ export class CommandModalComponent implements OnInit, OnDestroy {
cancelText: string;
form:NgForm;
validationMessage:string ;
btnClass:string;
successEmitter: EventEmitter<any>;
private _notifyMessage: Subscription;
@@ -20,6 +20,7 @@ export class CommandModalDirective {
@Input() commandText: string;
@Input() cancelText: string;
@Input() animated: boolean;
@Input() btnClass:string;
@Output() success: EventEmitter<any> = new EventEmitter<any>();
@@ -38,7 +39,8 @@ export class CommandModalDirective {
refreshOnSuccess: this.refreshOnSuccess === undefined ? true : this.refreshOnSuccess,
commandText: this.commandText || 'OK',
cancelText: this.cancelText || 'Cancel',
successEmitter: this.success
successEmitter: this.success,
btnClass: this.btnClass || 'primary'
};
this.modalService.show(CommandModalComponent, {
animated: this.animated === undefined ? true : this.animated,