How to write a alert controller in providers and return the index

Hi Guys,
I have return confirmation alert. In my program i have to use confirmation alert in multiple time and multiple places. Every page i have to use the code but handler and button text only changed, so i have to written one service and handler and it will return the call back function for the controller.


 this.alert = this.alertCtrl.create({
    title: title,
    subTitle: message,
    message: message,
    enableBackdropDismiss: false,
    buttons: [{
    text: "Cancel",
    role: "cancel",
    handler: () => {
        alert("user was cancelled")
    }, {
    text: "OK",
    role: "ok",
    handler: () => {
        alert("user accepted")


Thank you guys.

Have you managed to do it ?