Hi Goutham,
Thank you for contacting Syncfusion support.
Based on your requirement, we have prepared Dialog sample with template driven form support. The form validation is will be shown when you clear the text and click the Submit button in the Dialog footer. You can simply render the Dialog component inside the form element, kindly refer to the following code snippet.
<form #form="ngForm">
<div class="form-group">
<ejs-dialog #template>
<ng-template #header>
</ng-template>
<ng-template #content>
<ejs-autocomplete name="skillname" #value='ngModel' required [(ngModel)]='autoskillname'>
</ejs-autocomplete>
<div *ngIf="(value.invalid && value.touched)" class="alert alert-danger">
<div *ngIf="value.errors.required">
Value is required.
</div>
</div>
</ng-template>
<ng-template #footerTemplate>
<div class="col-xs-5 col-sm-5 col-lg-5 col-md-5"><button ejs-button>Submit</button></div>
<div class="col-xs-5 col-sm-5 col-lg-5 col-md-5"><button ejs-button (click)="onreset($event)"
type="reset" [disabled]="!form.valid">Reset</button></div>
</ng-template>
</ejs-dialog>
</div>
</form> |
Please let us know if you need any further assistance on this.
Regards,
Prince