Kaynağa Gözat

Starting AddNameIfMissing

Richard Knight 6 yıl önce
ebeveyn
işleme
78ff9f36d9
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      src/app/dynaform/libs/index.ts

+ 6 - 1
src/app/dynaform/libs/index.ts

@@ -1,8 +1,13 @@
 import { FormBuilder, FormControl } from '@angular/forms';
-import { reduce } from 'lodash/fp';
+import { map, reduce } from 'lodash/fp';
 
 const fb = new FormBuilder();
 
+// Add name if missing
+const addNameIfMissing = (val, key) => val.name ? val : Object.assign(val, { name: key });
+// TODO
+
+
 // Build Form Control
 // metaF = metadata for Field
 const buildControlState = metaF => ({ value: metaF.value || '', disabled: metaF.isDisabled });