title: Angular 2 Dart: How to bind events correctly to dynamically generated HTML (Removing disallowed attribute <DIV (click)="...">)?
body: <p>I want to bind a click-event to dynamically generated HTML in Angular Dart. How to do it correctly?</p>
  
  <p><strong>What I have tried:</strong></p>
  
  <p><em>home_component.dart:</em></p>
  
  <pre><code>void addHtml() {
   html = """
    &lt;div class="offer" (click)="offerGo()"&gt;
     ....
    &lt;/div&gt;""";
  
    offers.setInnerHtml(html);
  }
  
  void offerGo() {
   print("Offer clicked!");
  }
  </code></pre>
  
  <p>The HTML is correctly added however I get the following warning in the browser console:</p>
  
  <blockquote>
    <p>Removing disallowed attribute <code>&lt;DIV (click)="offerGo()"&gt;</code></p>
  </blockquote>
  
  <p>... and the click event does not fire when an offer is clicked.</p>