4

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 .

Hasan Daghash
  • 1,681
  • 1
  • 17
  • 29
  • can you provide your module declaration? There also should be injected the dependency. – Diana R Nov 09 '15 at 08:41
  • 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 Nov 09 '15 at 08:43
  • 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 Nov 09 '15 at 08:49
  • yes i use all this libs , no errors in console except the provided above – Hasan Daghash Nov 09 '15 at 08:53
  • Hm, Can you please create a plunkr to reproduce the issue you have? – Diana R Nov 09 '15 at 09:09
  • Are you including angular bootstrap, so that the $uibModal service is defined? http://angular-ui.github.io/bootstrap/#/top http://angular-ui.github.io/bootstrap/#/getting_started – Markus Nov 10 '15 at 23:12
  • @HasanDaghash were you able to figure this out? Having the same issue. – jgraft Nov 17 '15 at 19:53

4 Answers4

9

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

jgraft
  • 918
  • 8
  • 15
2

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.

piercebot
  • 1,767
  • 18
  • 16
  • Excellent point! It has to do with the dependence on bootstrap. Using ~5.2.6 for instance resolved me to bootstrap 3.0.5 which caused the issue. – Custodio Jan 28 '16 at 16:37
2

Refer this version, it will clear the error:

<script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.14.3.js"></script> 
Amay Kulkarni
  • 828
  • 13
  • 16
0

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> 
Ian Poston Framer
  • 938
  • 12
  • 16