Ionic where to define function for button defined in app.html

225 Views Asked by At

I have defined my Ionic side menu in app.html:

<ion-menu [content]="content" side="left">
  <ion-header>
    <ion-toolbar>
        <ion-title>Menu</ion-title>
    </ion-toolbar>
  </ion-header>

  <ion-content>
    <ion-list>
        <button  menuClose ion-item (click)="openProfilePage()">Start today's quiz</button>
    </ion-list>
  </ion-content>

</ion-menu>

Where can I define the function openProfilePage function. I mean in which file?

1

There are 1 best solutions below

3
On BEST ANSWER

You should define your function inside app.component.ts file.

public openProfilePage() {
    // Code here
}