add btnClass to command-modal
This commit is contained in:
+1
-1
@@ -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">
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ export class CommandModalComponent implements OnInit, OnDestroy {
|
||||
cancelText: string;
|
||||
form:NgForm;
|
||||
validationMessage:string ;
|
||||
|
||||
btnClass:string;
|
||||
successEmitter: EventEmitter<any>;
|
||||
|
||||
private _notifyMessage: Subscription;
|
||||
|
||||
+3
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user