From 780f76a3e8dd68abe6b007006f85a76991ea2c54 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Mon, 16 Apr 2018 13:40:28 +0800
Subject: [PATCH] Merge branch 'develop' of http://blit.7drlb.com:8888/r/screen-frontend into develop
---
src/app/business/services/util/tools.service.ts | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/app/business/services/util/tools.service.ts b/src/app/business/services/util/tools.service.ts
index 3afa1b1..3facff7 100644
--- a/src/app/business/services/util/tools.service.ts
+++ b/src/app/business/services/util/tools.service.ts
@@ -3,16 +3,29 @@
@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) {
+ Object.keys(obj).forEach(
+ (key: string) => {
+ if (key.startsWith('_')) {
+ delete obj[key];
+ } else {
+ if (obj[key] instanceof Object) {
+ ToolsService.removePrivate(obj[key]);
+ }
+ }
+ }
+ );
}
}
--
Gitblit v1.8.0