4
votes

I'm trying to use angular-bootstrap-lightbox , and i need to inject Lightbox provider into directive like so

controller: ['Lightbox' , function ($scope, $rootScope, $filter, FileUploader,Lightbox) {

but this is lead to the following error :

Error: [$injector:unpr] Unknown provider: $uibModalProvider <- $uibModal <- Lightbox <- Lightbox

any body can help to resolve this , Thanks in advance .

4
can you provide your module declaration? There also should be injected the dependency.Diana R
sure i put it : ['ngResource', 'ngCookies', 'ngAnimate', 'ngTouch', 'ngSanitize', 'ngMessages', 'ui.router', 'ui.bootstrap', 'ui.utils','xeditable','ngImgCrop','angularFileUpload','envConfig','angulartics','angulartics.google.analytics','bootstrapLightbox'];Hasan Daghash
what about script list that is imported into your page?do you have there all these libs? And second question - do you see any errors in console?Diana R
yes i use all this libs , no errors in console except the provided aboveHasan Daghash
Hm, Can you please create a plunkr to reproduce the issue you have?Diana R

4 Answers

9
votes

Version issue with ui-boostrap. Need to upgrade ui-bootstrap to be 0.14x or above. See this github issue as well

2
votes

If you are unable to upgrade angular-bootstrap past 0.12.0, make sure that your angular-dialog-service is at version 5.2.6 exactly (no ~s or ^s preceding it!). Downgrading angular-dialog-service solved this issue for us.

2
votes

Refer this version, it will clear the error:

<script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.14.3.js"></script> 
0
votes

Use this cdn script tag in the index of your angular app

  <script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.14.0.js"></script>