From f320f1970e5d80a423f377fb3253628bd1e7f5bf Mon Sep 17 00:00:00 2001 From: 沈斌 <bluelazysb@hotmail.com> Date: Thu, 08 Mar 2018 15:10:46 +0800 Subject: [PATCH] Merge branch 'develop' of ssh://121.40.92.176:29418/screen-frontend into develop --- src/app/business/services/util/tools.service.ts | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/business/services/util/tools.service.ts b/src/app/business/services/util/tools.service.ts index affe82f..3facff7 100644 --- a/src/app/business/services/util/tools.service.ts +++ b/src/app/business/services/util/tools.service.ts @@ -3,25 +3,25 @@ @Injectable() export class ToolsService { - public static markAsDirty(controlSet:FormGroup|FormArray){ + public static markAsDirty(controlSet: FormGroup|FormArray) { const controls = controlSet.controls; Object.values(controls).forEach( - (control:AbstractControl) => { - if(control instanceof FormGroup || control instanceof FormArray){ + (control: AbstractControl) => { + if (control instanceof FormGroup || control instanceof FormArray) { ToolsService.markAsDirty(control); - }else{ + } else { control.markAsDirty(); } } - ) + ); } - public static removePrivate(obj:object){ + public static removePrivate(obj: object) { Object.keys(obj).forEach( - (key:string) => { - if(key.startsWith('_')){ + (key: string) => { + if (key.startsWith('_')) { delete obj[key]; - }else{ - if(obj[key] instanceof Object){ + } else { + if (obj[key] instanceof Object) { ToolsService.removePrivate(obj[key]); } } -- Gitblit v1.8.0