|
@@ -2,7 +2,7 @@ import {
|
|
Directive, ComponentFactoryResolver, ComponentRef, ViewContainerRef,
|
|
Directive, ComponentFactoryResolver, ComponentRef, ViewContainerRef,
|
|
Input, Output, EventEmitter, OnInit, SkipSelf
|
|
Input, Output, EventEmitter, OnInit, SkipSelf
|
|
} from '@angular/core';
|
|
} from '@angular/core';
|
|
-import { Form, FormControl, ControlContainer, NgControl, ControlValueAccessor, ValidatorFn, AsyncValidatorFn } from '@angular/forms';
|
|
|
|
|
|
+import { Form, FormControl, ControlContainer, NgControl, ControlValueAccessor, ValidatorFn, AsyncValidatorFn, FormGroupName } from '@angular/forms';
|
|
|
|
|
|
import * as formFieldComponents from './../components';
|
|
import * as formFieldComponents from './../components';
|
|
|
|
|
|
@@ -56,6 +56,7 @@ export class DynafieldDirective extends NgControl implements OnInit /* OnChanges
|
|
);
|
|
);
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
|
|
+
|
|
const { name, class: cssClass, id: cssId, isDisabled } = this.meta;
|
|
const { name, class: cssClass, id: cssId, isDisabled } = this.meta;
|
|
|
|
|
|
// Create the component
|
|
// Create the component
|
|
@@ -88,6 +89,18 @@ export class DynafieldDirective extends NgControl implements OnInit /* OnChanges
|
|
this.valueAccessor = <FFCCustom>this.component.instance;
|
|
this.valueAccessor = <FFCCustom>this.component.instance;
|
|
this._control = this.formDirective.addControl(this);
|
|
this._control = this.formDirective.addControl(this);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // Connect custom groups
|
|
|
|
+ if (this.meta.meta) {
|
|
|
|
+ console.log('GROUP');
|
|
|
|
+ // this.name = name;
|
|
|
|
+ console.log(this.formDirective);
|
|
|
|
+ const whagga = new FormGroupName(this.cc, [], []);
|
|
|
|
+ whagga.name = 'checkbuttonGroup';
|
|
|
|
+ this.formDirective.addFormGroup(whagga);
|
|
|
|
+ console.log(this.formDirective);
|
|
|
|
+ }
|
|
|
|
+
|
|
} catch (e) {
|
|
} catch (e) {
|
|
console.error('ERROR INSTANTIATING DYNAFORM FIELD COMPONENT');
|
|
console.error('ERROR INSTANTIATING DYNAFORM FIELD COMPONENT');
|
|
console.log(e);
|
|
console.log(e);
|