aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/login/login.component.html
blob: 6368729420f1464bcc7af21bdd44eed6c305da3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<h3>Login</h3>

<div *ngIf="error" class="alert alert-danger">{{ error }}</div>

<form role="form" (ngSubmit)="login()" [formGroup]="loginForm">
  <div class="form-group">
    <label for="username">Username</label>
    <input
      type="text" class="form-control" name="username" id="username" placeholder="Username"
      [(ngModel)]="username"
    >
    <div [hidden]="loginForm.controls.username.valid || loginForm.controls.username.pristine" class="alert alert-danger">
      Username is required
    </div>
  </div>

  <div class="form-group">
    <label for="password">Password</label>
    <input
      type="password" class="form-control" name="password" id="password" placeholder="Password"
      [(ngModel)]="password"
    >
    <div [hidden]="loginForm.controls.password.valid || loginForm.controls.password.pristine" class="alert alert-danger">
      Password is required
    </div>
  </div>

  <input type="submit" value="Login" class="btn btn-default" [disabled]="!loginForm.valid">
</form>