Answers for "template driven form angular validation tutorila"

-1

email validation pattern angular

pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$"
Posted by: Guest on October-26-2020
2

angular html input validation template driven

content_copy
      
      <input id="name" name="name" class="form-control"
      required minlength="4" appForbiddenName="bob"
      [(ngModel)]="hero.name" #name="ngModel" >

<div *ngIf="name.invalid && (name.dirty || name.touched)"
    class="alert alert-danger">

  <div *ngIf="name.errors.required">
    Name is required.
  </div>
  <div *ngIf="name.errors.minlength">
    Name must be at least 4 characters long.
  </div>
  <div *ngIf="name.errors.forbiddenName">
    Name cannot be Bob.
  </div>

</div>
Posted by: Guest on September-06-2020

Code answers related to "template driven form angular validation tutorila"

Browse Popular Code Answers by Language