Ionic how to define onclick button event like normal html

 var contentString = [
            '<div style="padding:5px;" class="iw_inner">',
            '   <h5>'+this.arraytomarker[i].name+'</h5>',
            '   <p>'+this.arraytomarker[i].address+'</p>',
            '     <p> 좋음 </p>',
            '       <button  onclick="myFunction()" style="  width:100%;  background: transparent; border: solid 1px;">view</button>',
    var infowindow = new naver.maps.InfoWindow({
        content: contentString

I should use onclick event…but when I use it…it says error "myFunction is not defined…even though I made myFunction function like

  myFunction(event: any){

How can I solve this problem?

(click)="myFunction($event)" give the same error?