|
@@ -10,6 +10,16 @@ import { KeysPipe } from '@pipes/keys.pipe';
|
|
|
})
|
|
|
export class DynaformComponent implements OnInit {
|
|
|
|
|
|
+ /*
|
|
|
+ * USAGE
|
|
|
+ * Supply with either a FormGroup or the (string) name of a FormGroup, and the form meta data
|
|
|
+ * e.g.
|
|
|
+ * <app-dynaform [formGroup]="myForm" [meta]="myFormMetaData"></app-dynaform>
|
|
|
+ * <app-dynaform formGroupName="myFormGroupName" [meta]="myFormMetaData"></app-dynaform>
|
|
|
+ *
|
|
|
+ * If supplied with just a FormGroupName it will retieve the FormGroup from the injected ControlContainer
|
|
|
+ */
|
|
|
+
|
|
|
@Input()
|
|
|
formGroup?: FormGroup;
|
|
|
|
|
@@ -17,8 +27,8 @@ export class DynaformComponent implements OnInit {
|
|
|
formGroupName?: FormGroupName;
|
|
|
|
|
|
@Input()
|
|
|
- set meta(val) {
|
|
|
- this.formMetaData = val;
|
|
|
+ set meta(data) {
|
|
|
+ this.formMetaData = data;
|
|
|
}
|
|
|
|
|
|
formMetaData: any; // TODO: Tighten up type
|