Dismiss modal and prompt alert on press back button in ionic 3

I have a modal. In that modal i also have a prompt alert. I want to close first prompt alert then modal on pressing phone back button

I think

  1. Promt alert will close once you take any action on buttons inside promt alert
    2.For modal to close you need to work with
    import { ModalController } from ‘@ionic/angular’
    public modalController: ModalController
    this.modalController.dismiss(); in modal component.

I have a drop-down list in modal. if i dismiss modal the dropdown remains same on the top. So i need to first dismiss the dropdown then modal