0

html:

<ion-content padding>
<div [innerHTML]="bookContent"></div>
</ion-content>

ts:

  private bookContent: string = '<p>    this is a <a class="point"  (click)="pointClick(16)">point</a>, click to detail page.</p>';
  pointClick(id){
    this.navCtrl.push(PointPage, {pointId:id});
  }

The click event doesn't work. In the developer tool, I found 'click' isn't exist. no click in the 'a' element.

what should i do to achieve this function.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
qingchen191
  • 23
  • 1
  • 4
  • angular 2 doesnt really allow that..http://stackoverflow.com/questions/37676726/angular-2-innerhtml-click-binding – Suraj Rao Jan 11 '17 at 08:11
  • thank you for your suggest.Can i use elementRef.nativeElement.querySelector('a') ,and renderer.invokeElementMethod(element, 'click', []);? – qingchen191 Jan 11 '17 at 10:05

0 Answers0