[v1] $q.dialog() now returns a chainable object (with onOK/onCancel callbacks), not a promise. How to use promise with it?



  • Is there an option to let $q.dialog return a promise like it did in 0.17+ ? It is awkward to convert callbacks to promises and fit in the promise or async/await codes every time we use dialog.



  • Can you explain your use case some to understand your need for asynchronous confirmation or cancellation of qdialog? And not even knowing your use case, could you build a custom dialog component for whatever async dialog needs you have?

    Scott


  • Admin

    Something to get you started:

    return new Promise((resolve, reject) => {
     this.$q.dialog(...).onOk(resolve).onCancel(reject)
    }
    

Log in to reply