From 662d6be5c95b89c24fd966499ef6dcb5c9756ac3 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Tue, 19 Sep 2017 14:59:19 +0100 Subject: [PATCH] Linter error fixes for feedback component --- src/app/dashboard/feedback.component.ts | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/app/dashboard/feedback.component.ts b/src/app/dashboard/feedback.component.ts index 11d56d4..91ef375 100644 --- a/src/app/dashboard/feedback.component.ts +++ b/src/app/dashboard/feedback.component.ts @@ -7,18 +7,18 @@ import 'rxjs/add/operator/map'; @Component({ templateUrl: 'feedback.component.html', }) -export class FeedbackComponent { +export class FeedbackComponent implements OnInit { feedbackForm: FormGroup; loggedInEmail: string; - noEmail: boolean = false; + noEmail = false; username: any; feedbackFormStatus: any; - feedbackFormStatusError: string = 'Error received, please try again.'; + feedbackFormStatusError = 'Error received, please try again.'; constructor( private http: Http, - private formBuilder: FormBuilder, - private api: ApiService, + private formBuilder: FormBuilder, + private api: ApiService, ) { this.feedbackForm = this.formBuilder.group({ email: ['', [Validators.required]], @@ -28,7 +28,7 @@ export class FeedbackComponent { ngOnInit(): void { - if(localStorage.getItem('email')) { + if (localStorage.getItem('email')) { this.loggedInEmail = localStorage.getItem('email'); } console.log('loggedInEmail: ' + this.loggedInEmail); @@ -55,10 +55,10 @@ export class FeedbackComponent { .feedback(this.feedbackForm.value) .subscribe( result => { - if ( result.success == true ) { + if ( result.success === true ) { console.log('Successful Upload'); console.log(result); - this.feedbackFormStatus = "success"; + this.feedbackFormStatus = 'success'; console.log(this.feedbackFormStatus); this.feedbackForm.patchValue({ feedbacktext: '', @@ -66,7 +66,7 @@ export class FeedbackComponent { } else { console.log('Upload Error'); this.feedbackFormStatusError = JSON.stringify(result.status) + 'Error, ' + JSON.stringify(result.message); - this.feedbackFormStatus = "send_failed"; + this.feedbackFormStatus = 'send_failed'; console.log(this.feedbackFormStatus); } }, @@ -75,13 +75,13 @@ export class FeedbackComponent { console.log(error); try { console.log(error.error); - let jsonError = error.json(); - console.log("boop"); + const jsonError = error.json(); + console.log('boop'); this.feedbackFormStatusError = '"' + jsonError.error + '" Error, ' + jsonError.message; - } catch(e) { + } catch (e) { this.feedbackFormStatusError = 'There was a server error, please try again later.'; } - this.feedbackFormStatus = "send_failed"; + this.feedbackFormStatus = 'send_failed'; console.log(this.feedbackFormStatus); } );