Here I have one input field that I want to make mandatory url input field and I done this code.when I put url in input field or put any other text only input field in both case it saves input field and save in database. so, how to make mandatory url type input field in angular 6.
<form method="post" enctype="multipart/form-data">
<mat-form-field>
<input matInput type="url" pattern="https?://.+" placeholder="Large Icon" name="largeicon" #largeicon="ngModel"
[(ngModel)]="notificationObj.largeicon" required>
</mat-form-field>
<div *ngIf="largeicon.errors && (largeicon.dirty || largeicon.touched)" class="alert alert-danger">
<div [hidden]="!largeicon.errors.required">URL is required!</div>
<div [hidden]="!largeicon.errors.pattern">Must be a valid URL!</div>
</div>
<button mat-raised-button (click)="sendNotification()">SEND NOTIFICATION</button>
</form>