|
@@ -1,6 +1,5 @@
|
|
import { Component, Input, ViewChild, TemplateRef, Optional, OnInit } from '@angular/core';
|
|
import { Component, Input, ViewChild, TemplateRef, Optional, OnInit } from '@angular/core';
|
|
import { FormGroup, FormGroupName, AbstractControl, ControlContainer } from '@angular/forms';
|
|
import { FormGroup, FormGroupName, AbstractControl, ControlContainer } from '@angular/forms';
|
|
-
|
|
|
|
|
|
|
|
export interface DynarowContext {
|
|
export interface DynarowContext {
|
|
control: AbstractControl;
|
|
control: AbstractControl;
|
|
@@ -10,8 +9,7 @@ export interface DynarowContext {
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-dynaform',
|
|
selector: 'app-dynaform',
|
|
templateUrl: './dynaform.component.html',
|
|
templateUrl: './dynaform.component.html',
|
|
- styleUrls: ['./dynaform.component.scss'],
|
|
+ styleUrls: ['./dynaform.component.scss']
|
|
-
|
|
|
|
})
|
|
})
|
|
export class DynaformComponent implements OnInit {
|
|
export class DynaformComponent implements OnInit {
|
|
|
|
|
|
@@ -61,11 +59,9 @@ export class DynaformComponent implements OnInit {
|
|
this.formGroup = <FormGroup>this.cc.control;
|
|
this.formGroup = <FormGroup>this.cc.control;
|
|
}
|
|
}
|
|
if (!this.formGroup) {
|
|
if (!this.formGroup) {
|
|
- throw new Error('Dynaform Component Initialised without [formGroup] or formGroupName');
|
|
+ throw new Error('Dynaform Component initialised without [formGroup] or formGroupName');
|
|
}
|
|
}
|
|
this.controlNames = Object.keys(this.formGroup.controls);
|
|
this.controlNames = Object.keys(this.formGroup.controls);
|
|
- console.log('Dynaform Component: Controls >');
|
|
|
|
- console.log(this.controlNames);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
getTemplateContext(controlName: string): DynarowContext {
|
|
getTemplateContext(controlName: string): DynarowContext {
|