Below is the HTML code, the keyup will be triggered only if the input field value matched with the pattern.
<input (keyup)="checkPatternMatch(ProjectName)" type="text" #ProjectName="ngModel" name="pro-name" class="form-control" pattern=".*\S+.*">
pattern=".*\S+.*"
this pattern should atleast contains a single character (it does not consider space as a character).
Aucun commentaire:
Enregistrer un commentaire