fengxiang
2018-07-06 309d1f9d649daa08bb9b068af014749f6d4a5bce
src/app/business/services/util/tools.service.ts
@@ -15,6 +15,13 @@
             }
         );
      }
      public static getValueFormControl(controlSet: FormGroup, name: string) {
        return controlSet.controls[name].value;
      }
      public static setValueToControl(controlSet: FormGroup, name: string, value: any) {
         controlSet.controls[name].setValue(value);
         controlSet.controls[name].updateValueAndValidity();
      }
      public static removePrivate(obj: object) {
            Object.keys(obj).forEach(
                 (key: string) => {
@@ -37,4 +44,7 @@
        if (num) { result = num + result; }
        return result;
    }
    public static getObjById<T>(id: number, list: T[]): T {
        return list.find(item => item['id'] === id);
    }
}