tab2.page.html

    1. <ion-content>
    2. <ion-button color="primary" (click)="presentAlert()">Primary</ion-button>
    3. </ion-content>

    tab2.page.ts

    1. export class Tab2Page {
    2. constructor(public alertController: AlertController) {}
    3. async presentAlert() {
    4. const alert = await this.alertController.create({
    5. header: 'Alert',
    6. subHeader: 'Subtitle',
    7. message: 'This is an alert message.',
    8. buttons: ['OK']
    9. });
    10. await alert.present();
    11. }
    12. }