-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.page.html
75 lines (70 loc) · 2.41 KB
/
register.page.html
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title>Ionic Notes</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-card>
<ion-card-header>
<ion-card-subtitle>Enter your details</ion-card-subtitle>
<ion-card-title>Register</ion-card-title>
</ion-card-header>
<ion-card-content>
<form
class="form"
[formGroup]="validations_form"
(ngSubmit)="tryRegister(validations_form.value)"
>
<ion-label position="floating" color="primary">Name</ion-label>
<ion-input type="text" formControlName="name" placeholder="Name">
</ion-input>
<ion-label position="floating" color="primary">Email</ion-label>
<ion-input
type="text"
formControlName="email"
placeholder="Email"
></ion-input>
<div class="validation-errors">
<ng-container *ngFor="let validation of validation_messages.email">
<div
class="error-message"
*ngIf="validations_form.get('email').hasError(validation.type) &&
(validations_form.get('email').dirty || validations_form.get('email').touched )"
>
{{validation.message}}
</div>
</ng-container>
</div>
<ion-label position="floating" color="primary"> Password </ion-label>
<ion-input
type="password"
formControlName="password"
placeholder="Password"
></ion-input>
<div class="validation-errors">
<ng-container *ngFor="let validation of validation_messages.password">
<div
class="error-message"
*ngIf="validations_form.get('password').hasError(validation.type)
&& (validations_form.get('password').dirty || validations_form.get('password').touched)"
>
{{validation.message}}
</div>
</ng-container>
</div>
<ion-button
class="submit-btn"
type="submit"
[disabled]="!validations_form.valid"
>Register</ion-button
>
<label class="error-message">{{errorMessage}}</label>
<label class="success-message">{{successMessage}}</label>
</form>
<p>Have an account? <a routerLink="/home">Login </a></p>
</ion-card-content>
</ion-card>
</ion-content>