I have mat input field in angular 6 in which i am going to restrict (.)dot on empty field. if value presents dot needs allowed otherwise if empty input field means it should throw error like "dot not allowed'
how to achieve this in angular 6
anyone help me please...
<mat-form-field floatLabel="never" class="full-width transparent-form">
<input matInput name="hoursSpent" required #workedHoursValidation="ngModel"
placeholder="Worked hours:e.g:1.5 (or) 1" class="w-100" appNumberAloneMask [form]="form"
[ngModel]="newTaskHours" (input)="onSearchChange($event.target.value)" (ngModelChange)="newTaskHours = form.value.hoursSpent">
<mat-error *ngIf="workedHoursValidation.hasError('required')">Required</mat-error>
</mat-form-field>