|
@@ -1,4 +1,4 @@
|
|
|
-import { Component, Input, ViewChild, TemplateRef, Optional, OnInit } from '@angular/core';
|
|
|
+import { Component, Input, TemplateRef, Optional, OnInit } from '@angular/core';
|
|
|
import { FormGroup, FormGroupName, AbstractControl, ControlContainer } from '@angular/forms';
|
|
|
|
|
|
export interface DynarowContext {
|
|
@@ -48,8 +48,6 @@ export class DynaformComponent implements OnInit {
|
|
|
formMetaData: any; // TODO: Tighten up type
|
|
|
controlNames: string[];
|
|
|
|
|
|
- ctx = {ccc: 123};
|
|
|
-
|
|
|
constructor(
|
|
|
@Optional() private cc: ControlContainer
|
|
|
) {}
|
|
@@ -62,6 +60,9 @@ export class DynaformComponent implements OnInit {
|
|
|
throw new Error('Dynaform Component initialised without [formGroup] or formGroupName');
|
|
|
}
|
|
|
this.controlNames = Object.keys(this.formGroup.controls);
|
|
|
+ // this.controlNames = Object.values(this.formMetaData).map((metaFoG: StringMap) => metaFoG.name);
|
|
|
+ // console.log(this.controlNames);
|
|
|
+ // console.log(this.formGroup);
|
|
|
}
|
|
|
|
|
|
getTemplateContext(controlName: string): DynarowContext {
|
|
@@ -71,4 +72,8 @@ export class DynaformComponent implements OnInit {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+ getRowClass(inputType: string): string {
|
|
|
+ return `row-${inputType.toLowerCase().replace('component', '')}`;
|
|
|
+ }
|
|
|
+
|
|
|
}
|