I am trying to detect the change in one specific form element that was built using reactive forms.
I used *ngFor
and *ngSwitch
directives to build a reactive form as demonstrated in https://angular.io/docs/ts/latest/cookbook/dynamic-form.html#. My form currently contains input type text
and file
. I use the change event to capture the file upload task so I need to detect changes in the file
input element but not the text
input element. This is where I run into the problem. The form built using *ngSwitch
or *ngIf
doesn't seem to trigger the change
event. I have created a plunker that can be used to recreate the issue I am facing.
The form works fine if I detect changes in each form element. (form2 in the plunker example)
Please see plunker in the link below for a recreation of the issue I am facing. https://plnkr.co/edit/1dMfn7gmR3rHq6xcgr2a?p=preview
Does anyone know how to resolve this issue?