File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
libs/ngx-dynamic-form-builder/src/shared/utils Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ export class DynamicFormBuilder extends FormBuilder {
8
8
factoryModel : ClassType < TModel > ,
9
9
controlsConfig ?: {
10
10
[ key : string ] : any ;
11
- } , extra ?: {
11
+ } ,
12
+ extra ?: {
12
13
[ key : string ] : any ;
13
14
} | null
14
15
) : DynamicFormGroup < TModel > {
@@ -18,13 +19,12 @@ export class DynamicFormBuilder extends FormBuilder {
18
19
}
19
20
// experimental
20
21
if ( controlsConfig === undefined ) {
21
- newControlsConfig = new factoryModel ( { } ) ;
22
+ newControlsConfig = new factoryModel ( ) ;
22
23
Object . keys ( newControlsConfig ) . forEach ( key => {
23
24
if (
24
25
newControlsConfig [ key ] &&
25
26
newControlsConfig [ key ] . constructor &&
26
27
typeof newControlsConfig [ key ] === 'object' &&
27
- newControlsConfig [ key ] . __not_group !== true &&
28
28
(
29
29
newControlsConfig [ key ] . length === undefined ||
30
30
(
@@ -33,10 +33,10 @@ export class DynamicFormBuilder extends FormBuilder {
33
33
)
34
34
)
35
35
) {
36
- newControlsConfig [ key ] . __not_group = true ;
37
36
newControlsConfig [ key ] = this . group (
38
37
newControlsConfig [ key ] . constructor ,
39
- controlsConfig !== undefined ? newControlsConfig [ key ] : undefined
38
+ undefined ,
39
+ extra
40
40
) ;
41
41
}
42
42
} ) ;
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ export class DynamicFormGroup<TModel> extends FormGroup {
174
174
if ( object !== undefined ) {
175
175
Object . keys ( this . controls ) . forEach ( key => {
176
176
if ( this . controls [ key ] instanceof DynamicFormGroup ) {
177
- object [ key ] = ( this . controls [ key ] as DynamicFormGroup < any > ) . value ;
177
+ object [ key ] = ( this . controls [ key ] as DynamicFormGroup < any > ) . object ;
178
178
} else {
179
179
object [ key ] = this . controls [ key ] . value ;
180
180
}
You can’t perform that action at this time.
0 commit comments