Linter error fixes for feedback component

This commit is contained in:
Tom Bloor 2017-09-19 14:59:19 +01:00
parent 921b25718d
commit 662d6be5c9

View file

@ -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);
}
);