diff options
Diffstat (limited to 'client/src/app/login/login.component.html')
-rw-r--r-- | client/src/app/login/login.component.html | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html index 5848fcba3..94a405405 100644 --- a/client/src/app/login/login.component.html +++ b/client/src/app/login/login.component.html | |||
@@ -1,17 +1,16 @@ | |||
1 | <h3>Login</h3> | 1 | <h3>Login</h3> |
2 | 2 | ||
3 | |||
4 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> | 3 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> |
5 | 4 | ||
6 | <form role="form" (ngSubmit)="login(username.value, password.value)" #loginForm="ngForm"> | 5 | <form role="form" (ngSubmit)="login()" [formGroup]="form"> |
7 | <div class="form-group"> | 6 | <div class="form-group"> |
8 | <label for="username">Username</label> | 7 | <label for="username">Username</label> |
9 | <input | 8 | <input |
10 | type="text" class="form-control" name="username" id="username" placeholder="Username" required | 9 | type="text" class="form-control" id="username" placeholder="Username" required |
11 | ngControl="username" #username="ngForm" | 10 | formControlName="username" |
12 | > | 11 | > |
13 | <div [hidden]="username.valid || username.pristine" class="alert alert-danger"> | 12 | <div *ngIf="formErrors.username" class="alert alert-danger"> |
14 | Username is required | 13 | {{ formErrors.username }} |
15 | </div> | 14 | </div> |
16 | </div> | 15 | </div> |
17 | 16 | ||
@@ -19,12 +18,12 @@ | |||
19 | <label for="password">Password</label> | 18 | <label for="password">Password</label> |
20 | <input | 19 | <input |
21 | type="password" class="form-control" name="password" id="password" placeholder="Password" required | 20 | type="password" class="form-control" name="password" id="password" placeholder="Password" required |
22 | ngControl="password" #password="ngForm" | 21 | formControlName="password" |
23 | > | 22 | > |
24 | <div [hidden]="password.valid || password.pristine" class="alert alert-danger"> | 23 | <div *ngIf="formErrors.password" class="alert alert-danger"> |
25 | Password is required | 24 | {{ formErrors.password }} |
26 | </div> | 25 | </div> |
27 | </div> | 26 | </div> |
28 | 27 | ||
29 | <input type="submit" value="Login" class="btn btn-default" [disabled]="!loginForm.form.valid"> | 28 | <input type="submit" value="Login" class="btn btn-default" [disabled]="!form.valid"> |
30 | </form> | 29 | </form> |