obj = {
id: 1,
data: 'please click here <button (click)="someFunction()">do job</button>. did you click it? okey now click here <button (click)="someFunction()">another button with click</button>'
}
I kinda understand, but why keep the template data in the obj variable inside your .ts file and not directly in the .html file?
<ion-list>
<ion-item *ngFor="let item of items">
please click here <button (click)="someFunction()">do job</button>. did you click it? okey now click here <button (click)="someFunction()">another button with click</button>
</ion-item>
</ion-list>
because i give you small piece of my data to demonstrate what i want. I have big data with many buttons inside and because my data is big i serve it from objects.js file with providers. So is anyone here who can say why click event doesn’t work?
Any time I feel the urge to directly interact with the DOM in an Angular application, I ask myself very critically to find another design that doesn’t require that.
I would change the way the data is represented to something other than HTML and have the template be capable of processing whatever structured format that is. For example: