Newer
Older
import { Directive, Input, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { ElementComponent } from './element-component.directive';
export abstract class FormElementComponent extends ElementComponent implements OnInit {
this.elementFormControl = this.parentForm ?
this.parentForm.controls[this.elementModel.id] as FormControl :
new FormControl(this.elementModel.value);