Answers for "required validation in angular"

-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
3

validation minlength angular

Validators.minLength(9)
Posted by: Guest on July-23-2020
2

formgroup check if valid

form: FormGroup;

onSubmit(){
    //checks if form is valid
       if( this.form.valid){
          //more code here
        }
}
Posted by: Guest on July-31-2020

Code answers related to "required validation in angular"

Browse Popular Code Answers by Language