Change cancel button text on modal page

Hi, i can’t change the default cancel button text in modal page. Have you any method for change it? Thanks

How do you create said modal?

I created the modal like this:

goToModalPage(){

let modal = this.modalCtrl.create(ModalPage);
    modal.present();

}

A modal have not a “default” cancel text. Your modal header should look like that

<ion-header>
  <ion-toolbar color="lol-orange">
    <ion-title>
     Hello
    </ion-title>
    <ion-buttons start>
      <button ion-button (click)="dismiss()">
        <span ion-text showWhen="ios" style="color: white">Close</span>
        <ion-icon name="md-close" showWhen="android,windows"></ion-icon>
      </button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

And in your .ts file

  dismiss() {
    this.viewCtrl.dismiss();
  }
1 Like

Thanks, I did not think to look at the modal html page … Sorry for the inconvenience and thanks again

1 Like