Fixed forms and added code

This commit is contained in:
piratefinn 2017-05-12 12:58:12 +01:00
parent fd810c1279
commit 400608e8dd
4 changed files with 14 additions and 4 deletions

View file

@ -10,7 +10,7 @@
<form [formGroup]="signin" (ngSubmit)="onSubmit()"> <form [formGroup]="signin" (ngSubmit)="onSubmit()">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-addon">@</span> <span class="input-group-addon">@</span>
<input type="text" class="form-control" placeholder="Email"> <input type="text" class="form-control" formControlName="email" placeholder="Email">
</div> </div>
<div class="input-group mb-4"> <div class="input-group mb-4">
<span class="input-group-addon"><i class="icon-lock"></i></span> <span class="input-group-addon"><i class="icon-lock"></i></span>
@ -18,7 +18,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<button type="button" class="btn btn-primary px-4">Login</button> <button type="submit" class="btn btn-primary px-4">Login</button>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
<button type="button" class="btn btn-link px-0">Forgot password?</button> <button type="button" class="btn btn-link px-0">Forgot password?</button>

View file

@ -36,7 +36,7 @@ export class LoginComponent {
console.log(this.signin.value); console.log(this.signin.value);
this.api this.api
.register(this.signin.value) .login(this.signin.value)
.subscribe( .subscribe(
result => { result => {
console.log('logged in!'); console.log('logged in!');

View file

@ -13,6 +13,15 @@
</div> </div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-addon"><i class="icon-people"></i></span>
<select required class="form-control" type="text" formControlName="usertype">
<option value=''>Please select</option>
<option value='customer'>Customer</option>
<option value='organisation'>Organisation</option>
</select>
</div>
<div class="input-group mb-3">
<span class="input-group-addon"><i class="icon-user"></i></span> <span class="input-group-addon"><i class="icon-user"></i></span>
<input type="text" class="form-control" formControlName="full_name" placeholder="Username"> <input type="text" class="form-control" formControlName="full_name" placeholder="Username">
</div> </div>
@ -49,7 +58,7 @@
<input type="password" class="form-control" formControlName="password" placeholder="Repeat password"> <input type="password" class="form-control" formControlName="password" placeholder="Repeat password">
</div> </div>
<button type="button" class="btn btn-block btn-success">Create Account</button> <button type="submit" class="btn btn-block btn-success">Create Account</button>
</form> </form>
</div> </div>
</div> </div>

View file

@ -28,6 +28,7 @@ export class RegisterComponent {
); );
this.signup = this.formBuilder.group({ this.signup = this.formBuilder.group({
token: ['', [Validators.required]], token: ['', [Validators.required]],
usertype: ['', [Validators.required]],
full_name: ['', [Validators.required]], full_name: ['', [Validators.required]],
display_name: ['', [Validators.required]], display_name: ['', [Validators.required]],
email: ['', [Validators.required]], email: ['', [Validators.required]],