From df98563e2104b82b119c00a3cd83cd0dc1242d25 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jun 2017 14:32:15 +0200 Subject: Use typescript standard and lint all files --- .../account-details/account-details.component.ts | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'client/src/app/account/account-details/account-details.component.ts') diff --git a/client/src/app/account/account-details/account-details.component.ts b/client/src/app/account/account-details/account-details.component.ts index 30e5b14ee..d7531cb55 100644 --- a/client/src/app/account/account-details/account-details.component.ts +++ b/client/src/app/account/account-details/account-details.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { Router } from '@angular/router'; +import { Component, OnInit, Input } from '@angular/core' +import { FormBuilder, FormGroup } from '@angular/forms' +import { Router } from '@angular/router' -import { NotificationsService } from 'angular2-notifications'; +import { NotificationsService } from 'angular2-notifications' -import { AuthService } from '../../core'; +import { AuthService } from '../../core' import { FormReactive, User, UserService, USER_PASSWORD -} from '../../shared'; +} from '../../shared' @Component({ selector: 'my-account-details', @@ -18,51 +18,51 @@ import { }) export class AccountDetailsComponent extends FormReactive implements OnInit { - @Input() user: User = null; + @Input() user: User = null - error: string = null; + error: string = null - form: FormGroup; - formErrors = {}; - validationMessages = {}; + form: FormGroup + formErrors = {} + validationMessages = {} - constructor( + constructor ( private authService: AuthService, private formBuilder: FormBuilder, private router: Router, private notificationsService: NotificationsService, private userService: UserService ) { - super(); + super() } - buildForm() { + buildForm () { this.form = this.formBuilder.group({ - displayNSFW: [ this.user.displayNSFW ], - }); + displayNSFW: [ this.user.displayNSFW ] + }) - this.form.valueChanges.subscribe(data => this.onValueChanged(data)); + this.form.valueChanges.subscribe(data => this.onValueChanged(data)) } - ngOnInit() { - this.buildForm(); + ngOnInit () { + this.buildForm() } - updateDetails() { - const displayNSFW = this.form.value['displayNSFW']; + updateDetails () { + const displayNSFW = this.form.value['displayNSFW'] const details = { displayNSFW - }; + } - this.error = null; + this.error = null this.userService.updateDetails(details).subscribe( () => { - this.notificationsService.success('Success', 'Informations updated.'); + this.notificationsService.success('Success', 'Informations updated.') - this.authService.refreshUserInformations(); + this.authService.refreshUserInformations() }, err => this.error = err - ); + ) } } -- cgit v1.2.3