bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

No access to promise returned by the Modal template loading

Open lastnico opened this issue 13 years ago • 3 comments

Because we can't access the promise in charge of loading the template of a Dialog, it is impossible to know whether or not the loading worked fine (and handle error cases related to 4XX and 5XX error codes)

lastnico avatar Apr 25 '13 07:04 lastnico

@lastnico I'm not sure we want to expose the current promise that is used to open the modal. The issue is that there are way too many internals in the results of this promise (content of a partial mostly).

What are the errors you are talking about here? Downloading HTML fragment? Or resolving data?

AngularJS relays on events to propagate info about route change status, we could explore this. At the same time promises are much nicer so we could expose another promise (not the one used internally) so people can monitor progress.

$dialog probably deserves some API refreshing so I will keep this one open and will come back to it when doing changes.

pkozlowski-opensource avatar Apr 25 '13 18:04 pkozlowski-opensource

@pkozlowski-opensource Then maybe accessing a promise with a limited scope to handle for instance the failure if the download of the HTML fragment fails, if its compilation fails,...

If indeed some changes in the $dialog API are planned, then let's wait what it will bring new ;) (if possible, could you also think about sending the events show, shown, hide and hidden that are sent by the original Bootstrap implementation, that would be great too ;)

lastnico avatar Apr 30 '13 07:04 lastnico

It will be handled in https://github.com/angular-ui/bootstrap/issues/441

pkozlowski-opensource avatar May 15 '13 17:05 pkozlowski-opensource