Commit a3ff68af authored by Wosiek, Oliver's avatar Wosiek, Oliver
Browse files

einloggen mit neu erstelltem Nutzer jetzt möglich

parent 3e5cd9fa
Pipeline #4271 passed with stage
in 3 minutes and 39 seconds
......@@ -21,7 +21,7 @@ class LoginComponent implements OnInit {
final LoginService _loginService;
//Später löschen
User user = mockUsers[0]; //Später verändern
User user = User(1, "", "", "", "", ""); //Später verändern
Future<void> login() async {
for (int i = 0; i < mockUsers.length; i++) {
......
......@@ -26,6 +26,7 @@ class RegisterComponent implements OnInit {
final int id = mockUsers.last.id +1;
user.id = id;
mockUsers.add(user);
print(user.toString());
await _registerService.update(user/*.id, user.nickname, user.email, user.password*/); //.create()
await _router.navigate('/login');
}
......
......@@ -6,6 +6,7 @@
#nickname="ngForm"
[class.is-valid]="nickname.valid"
[class.is-invalid]="!nickname.valid"
[(ngModel)]="user.nickname"
ngControl="nickname">
</div>
<div class="form-group">
......@@ -14,6 +15,7 @@
#surename="ngForm"
[class.is-valid]="surename.valid"
[class.is-invalid]="!surename.valid"
[(ngModel)]="user.surname"
ngControl="surename">
</div>
<div class="form-group">
......@@ -22,6 +24,7 @@
#name="ngForm"
[class.is-valid]="name.valid"
[class.is-invalid]="!name.valid"
[(ngModel)]="user.name"
ngControl="name">
</div>
<div class="form-group">
......@@ -30,11 +33,12 @@
#email="ngForm"
[class.is-valid]="email.valid"
[class.is-invalid]="!email.valid"
[(ngModel)]="user.email"
ngControl="email">
</div>
<div class="form-group">
<label for="mobileNo">Mobile Number</label>
<input type="text" class="form-control" id="mobileNo" placeholder="Mobile Number">
<input type="text" class="form-control" id="mobileNo" placeholder="Mobile Number" [(ngModel)]="user.mobileNo">
</div>
<div class="form-group">
<label for="password">Password&nbsp;*</label>
......@@ -43,6 +47,7 @@
#password="ngForm"
[class.is-valid]="password.valid"
[class.is-invalid]="!password.valid"
[(ngModel)]="user.password"
ngControl="password">
<div [hidden]="password.valid || password.pristine" class="invalid-feedback">
Password must contain at least one number and one uppercase and lowercase letter,
......@@ -51,6 +56,6 @@
</div>
<button type="submit" class="btn btn-success" (click)="register()">Register</button>
<button type="button" class="btn btn-success" (click)="register()">Register</button>
<button type="button" class="btn btn-danger" (click)="cancel()">Cancel</button>
</form>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment