tab2.page.html
<ion-content>
<ion-button color="primary" (click)="presentAlert()">Primary</ion-button>
</ion-content>
tab2.page.ts
export class Tab2Page {
constructor(public alertController: AlertController) {}
async presentAlert() {
const alert = await this.alertController.create({
header: 'Alert',
subHeader: 'Subtitle',
message: 'This is an alert message.',
buttons: ['OK']
});
await alert.present();
}
}