diff --git a/src/app/auth/login.component.html b/src/app/auth/login.component.html
index d105d32..a30d712 100644
--- a/src/app/auth/login.component.html
+++ b/src/app/auth/login.component.html
@@ -16,9 +16,19 @@
+
+
+
+ Login Succeeded, routing to homepage.
+
+
+ Error received, please try again.
+
+
+
-
+
diff --git a/src/app/auth/login.component.ts b/src/app/auth/login.component.ts
index b3d8f6d..829de5d 100644
--- a/src/app/auth/login.component.ts
+++ b/src/app/auth/login.component.ts
@@ -12,6 +12,7 @@ import 'rxjs/add/operator/map';
export class LoginComponent implements OnInit {
signin: FormGroup;
returnUrl: string;
+ loginStatus: any;
constructor(
private route: ActivatedRoute,
@@ -52,10 +53,14 @@ export class LoginComponent implements OnInit {
.subscribe(
result => {
console.log('logged in!');
+ this.loginStatus = "success";
+ console.log(this.loginStatus);
this.router.navigate([this.returnUrl]);
},
error => {
console.log( error._body );
+ this.loginStatus = "send_failed";
+ console.log(this.loginStatus);
}
);
}
diff --git a/src/app/auth/register.component.html b/src/app/auth/register.component.html
index e311d4b..a54fb0a 100644
--- a/src/app/auth/register.component.html
+++ b/src/app/auth/register.component.html
@@ -130,10 +130,21 @@
-
+
Please Select a User Type
+
+
+ Register Succeeded.
+
+
+ Form validation failed, please ensure the form is filled.
+
+
+ Failed to send to server, please try again later.
+
+
diff --git a/src/app/auth/register.component.ts b/src/app/auth/register.component.ts
index eeb4c7e..83846bc 100644
--- a/src/app/auth/register.component.ts
+++ b/src/app/auth/register.component.ts
@@ -16,6 +16,7 @@ export class RegisterComponent {
customerForm: ValidationManager;
organisationForm: ValidationManager;
years: Object[];
+ registerStatus: any;
constructor(
private http: Http,
@@ -57,6 +58,8 @@ export class RegisterComponent {
console.log(this.signupForm.isValid());
if (!this.signupForm.isValid() && !this.customerForm.isValid()) {
console.log("Not Valid!");
+ this.registerStatus = "validation_failed";
+ console.log(this.registerStatus);
return;
}
let signupForm = this.signupForm.getForm().value;
@@ -90,6 +93,8 @@ export class RegisterComponent {
console.log(this.signupForm.isValid());
if (!this.signupForm.isValid() || !this.organisationForm.isValid()) {
console.log("Not Valid!");
+ this.registerStatus = "validation_failed";
+ console.log(this.registerStatus);
return;
}
let signupForm = this.signupForm.getForm().value;
@@ -112,10 +117,14 @@ export class RegisterComponent {
.subscribe(
result => {
console.log('registered!');
- this.router.navigate(['/dashboard']);
+ this.registerStatus = "success";
+ console.log(this.registerStatus);
+ this.router.navigate(['/dashboard']);
},
error => {
console.log( error._body );
+ this.registerStatus = "send_failed";
+ console.log(this.registerStatus);
}
);
}