How to access NgFormControl in custom Ng2 form element

Issue I wrote my own custom form element DateInputComponent by implementing ControlValueAccessor and use it like this: <my-date-input ngControl=”date”></my-date-input> From what I understand, ngControl is syntactic sugar for [ngFormControl]=”myControlGroup.controls[‘date’]”. Now, inside my DateInputComponent I would like to access the NgFormControl.

Continue reading

How to access NgFormControl in custom Ng2 form element

Issue I wrote my own custom form element DateInputComponent by implementing ControlValueAccessor and use it like this: <my-date-input ngControl=”date”></my-date-input> From what I understand, ngControl is syntactic sugar for [ngFormControl]=”myControlGroup.controls[‘date’]”. Now, inside my DateInputComponent I would like to access the NgFormControl.

Continue reading