I want to configure httpInterceptor to show a general modal dialog when an http request fails. I use https://angular-ui.imtqy.com/bootstrap/ for a modal dialog.
I tried
app.config(function ($httpProvider, $uibModal) { ...
but got an error [$ injector: modulerr] Unable to create a module application because of: Error: [$ injector: unpr] Unknown provider: $ uibModal
This answer indicates that you can skip providers when setting up, so I tried
app.config(function ($httpProvider, $uibModalProvider) {
which works in the place where I want to open modal
var modalInstance = $uibModalProvider.open(
and I get an error that the object does not support the function or method open. How can I get from a provider to a modal instance, or is there any other way to achieve this?
source share