edit form in angular 8

Solutions on MaxInterview for edit form in angular 8 by the best coders in the world

showing results for - "edit form in angular 8"
Clara
16 May 2019
1<div class="row">
2
3  <div class="col-md-6 login-container">
4    <h2 style="margin: auto">Login </h2>
5    <form [formGroup]="loginForm" (ngSubmit)="onSubmit()">
6      <div class="form-group">
7        <label for="username">UserName:</label>
8        <input type="text" class="form-control" formControlName="username" id="username" autocomplete="off">
9        <div class="error" *ngIf="loginForm.controls['username'].hasError('required') && loginForm.controls['username'].touched">Username is required</div>
10      </div>
11      <div class="form-group">
12        <label for="pwd">Password:</label>
13        <input type="password" class="form-control" formControlName="password" id="pwd" autocomplete="off">
14        <div class="error" *ngIf="loginForm.controls['password'].hasError('required') && loginForm.controls['password'].touched">Password is required</div>
15      </div>
16      <button class="btn btn-success" [disabled]="loginForm.invalid">Login</button>
17      <div *ngIf="invalidLogin" class="error">
18        <div>Invalid credentials.</div>
19      </div>
20    </form>
21  </div>
22</div>
23