Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created March 26, 2018 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debugmodedotnet/b5a0513b0ded1ec5d5a95d4944cb0412 to your computer and use it in GitHub Desktop.
Save debugmodedotnet/b5a0513b0ded1ec5d5a95d4944cb0412 to your computer and use it in GitHub Desktop.
<form (ngSubmit)='loginUser()' [formGroup]='loginForm' novalidate class="form">
<input formControlName='email' type="text" class="form-control" placeholder="Enter Email" />
<div class="alert alert-danger" *ngIf="loginForm.get('email').hasError('required') && loginForm.get('email').touched">
Email is required
</div>
<input formControlName='password' type="password" class="form-control" placeholder="Enter Password" />
<input formControlName='phonenumber' type="text" class="form-control" placeholder="Enter Phone Number" />
<div class="alert alert-danger" *ngIf="loginForm.get('phonenumber').hasError('required') && loginForm.get('phonenumber').touched">
Phone Number is required
</div>
<br />
<button [disabled]='loginForm.invalid' class="btn btn-default">Login</button>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment