Open ghost opened 9 years ago
Resolve only resolves 'data'
so the default controllers behave in a consistent and predictable manner.
See https://github.com/m-e-conroy/angular-dialog-service/blob/master/src/dialogs-services.js#L260
You can fire the modal when the data is available ...
var asyncData = fnWhichReturnsPromise().then(function (result) {
data.asyncData = result;
return dialogs.create('/address/to/modal/template.html', 'ModalController', data).result;
}, function () {
// something bad happened
})
Although according to the docs and examples, you can pass data onto the modal controller using the third parameter
data
indialogs.create('address/to/modal/template.html', 'ModalController', data, opts)
, this is only good for ready data only, and not for asynchronous data.UI-Bootstrap native modal, has the
resolve
property to handle asynchronous data, and since this library is build on top of that, how would I got on utilizing this functionality of UI-Bootstrap Modal?I already tried passing a
resolve
property inside the fourth parameteropts
but although the function did get called upon opening the modal, I dont know how to get the retrieved data onto my
ModalController
. I already tried injecting the key name of my async data but with no luck