title: Add (input) to html tag dynamically in Typescript
body: <p>I have some html that is dynamically generated - I cannot modify it directly.  </p>
  
  <p>In this html is an <code>&lt;input class="MyInputClass"&gt;</code> with class specified (without id) and many other atrributes. I would like to handle this input (it's text) so that it does something (let's say: writes itself to console) when something is written to this input.  </p>
  
  <p>If I had an access to this in html I would do it like this:</p>
  
  <pre><code>&lt;input type="text" class="form-control (input)="onSearchChange($event.target.value)"&gt;
  
  public onSearchChange(searchValue : string ) {
      console.log(searchValue);
  }
  </code></pre>
  
  <p>Source: <a href="https://stackoverflow.com/questions/35359358/angular-2-change-event-on-every-keypress">Angular 2 change event on every keypress</a></p>
  
  <p>Is it possible to inject such handler?</p>