diff --git a/frontend/src/app/auth/auth.component.ts b/frontend/src/app/auth/auth.component.ts index fd06de8..9c00b22 100644 --- a/frontend/src/app/auth/auth.component.ts +++ b/frontend/src/app/auth/auth.component.ts @@ -8,7 +8,7 @@ import { Router } from '@angular/router'; }) export class AuthComponent implements OnInit { - @Input() authMode: 'Login' | 'Register' = 'Login'; + @Input() authMode: 'login' | 'register' = 'login'; constructor( private router: Router ) { } @@ -33,11 +33,11 @@ export class AuthComponent implements OnInit { } isLoginMode() { - return this.authMode === 'Login'; + return this.authMode === 'login'; } isRegisterMode() { - return this.authMode === 'Register'; + return this.authMode === 'register'; } diff --git a/frontend/src/app/register-form/register-form.component.html b/frontend/src/app/register-form/register-form.component.html index 07e94b5..f47a799 100644 --- a/frontend/src/app/register-form/register-form.component.html +++ b/frontend/src/app/register-form/register-form.component.html @@ -6,6 +6,13 @@ name='email' [(ngModel)]="signUpUser.email" class="validate" /> + + + + + - - -
-
-

Passwords must match

-
+
+ + + Passwords must match
+ diff --git a/frontend/src/app/register-form/register-form.component.ts b/frontend/src/app/register-form/register-form.component.ts index 7468db0..468a694 100644 --- a/frontend/src/app/register-form/register-form.component.ts +++ b/frontend/src/app/register-form/register-form.component.ts @@ -1,5 +1,4 @@ - -import {Component, OnInit, EventEmitter, Output} from '@angular/core'; +import {Component, OnInit, Output, EventEmitter} from '@angular/core'; import {AuthService} from '../services/auth.service'; @Component({ @@ -17,28 +16,24 @@ export class RegisterFormComponent implements OnInit { @Output() onFormResult = new EventEmitter(); - constructor(public authService: AuthService) { } + constructor(public authService: AuthService) {} ngOnInit() {} - onSignUpSubmit() { this.authService.registerUser(this.signUpUser).subscribe( - - (res) => { - + res => { if (res.status === 200) { this.onFormResult.emit({signedUp: true, res}); } - }, - - (err) => { - console.log(err.json()); + err => { + console.log('err:', err); this.onFormResult.emit({signedUp: false, err}); } ); } + } \ No newline at end of file diff --git a/frontend/src/app/toolbar/toolbar.component.html b/frontend/src/app/toolbar/toolbar.component.html index 8e0f9ad..114baed 100644 --- a/frontend/src/app/toolbar/toolbar.component.html +++ b/frontend/src/app/toolbar/toolbar.component.html @@ -27,7 +27,7 @@
- John Smith + John Smith

{{authTokenService.currentUserData.name}} Bob Smith
{{authTokenService.currentUserData.email}}