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