validation error component in cdk.
This commit is contained in:
+2
-2
@@ -6,8 +6,8 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ng-container [ngTemplateOutlet]="template"
|
||||
[ngTemplateOutletContext]="{ $implicit: commandModel, loading: loading }"></ng-container>
|
||||
<div *ngIf="hasError" class="alert alert-danger mt-2" style="white-space: pre-wrap">{{validationMessage}}</div>
|
||||
[ngTemplateOutletContext]="{ $implicit: commandModel, loading: loading, dataSource: dataSource }"></ng-container>
|
||||
<div *ngIf="hasError && !disableValidationSummary" class="alert alert-danger mt-2" style="white-space: pre-wrap">{{validationMessage}}</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" (click)="modalRef.hide()"
|
||||
|
||||
+1
@@ -23,6 +23,7 @@ export class CommandModalComponent implements OnInit, OnDestroy {
|
||||
cancelText: string;
|
||||
form:NgForm;
|
||||
validationMessage:string ;
|
||||
disableValidationSummary: boolean;
|
||||
btnClass:string;
|
||||
successEmitter: EventEmitter<any>;
|
||||
hasError: boolean;
|
||||
|
||||
+2
@@ -22,6 +22,7 @@ export class CommandModalDirective {
|
||||
@Input() animated: boolean;
|
||||
@Input() btnClass:string;
|
||||
@Input() modalSize: string;
|
||||
@Input() disableValidationSummary: boolean;
|
||||
|
||||
@Output() success: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@@ -37,6 +38,7 @@ export class CommandModalDirective {
|
||||
commandModel: commandModel,
|
||||
template: this.template,
|
||||
title: this.commandTitle,
|
||||
disableValidationSummary: this.disableValidationSummary === undefined ? false : this.disableValidationSummary,
|
||||
refreshOnSuccess: this.refreshOnSuccess === undefined ? true : this.refreshOnSuccess,
|
||||
commandText: this.commandText || 'OK',
|
||||
cancelText: this.cancelText || 'Cancel',
|
||||
|
||||
Reference in New Issue
Block a user