title: Ho to dynamically change the assigned eventHandler to a specific input element?
body: <p>I have a child component which generates a couple of input fields dynamically in a parent component. </p>
  
  <pre><code>&lt;app-xxx *ngFor="let el of fieldsElements" 
           [ngModel]="fieldsElements[el.name]"
           ...
           ...
           (keydown)="myFunction(yyy, zzz)"&gt;
  &lt;/app-xxx&gt;
  </code></pre>
  
  <p>The issue is that I would like to call <strong><code>myFunction()</code></strong> using <strong><code>click()</code></strong> <strong>eventHandler</strong> if the input has a specific name, but for the rest, I want to keep <strong><code>(keydown)</code></strong>. Or let's say for one of the generated input fields, I want to assign <strong><code>(click)</code></strong> instead of <strong><code>(keydown)</code></strong>. Example:</p>
  
  <pre><code>&lt;app-xxx *ngFor="let el of fieldsElements" 
           [ngModel]="fieldsElements[el.name]"
           ...
           ...
           (click)="myFunction(yyy, zzz)"&gt;
  &lt;/app-xxx&gt;
  </code></pre>
  
  <p>How can I achieve this dynamically in the <strong>HTML/View</strong>? I have been trying couple of options using <strong><code>*ngIf</code></strong> and some other options within the <strong><code>ts</code></strong> file using an if-statement and <strong><code>addEventListener()</code></strong> etc.
  None of them did help.</p>
  
  <p>Any hint or idea?</p>