angular-bootstrap-lightbox icon indicating copy to clipboard operation
angular-bootstrap-lightbox copied to clipboard

Unknown provider: LightboxProvider <- Lightbox

Open vsrboth opened this issue 8 years ago • 6 comments

I am trying to use this with ionic project, but I keep having this kind of bug:

ionic.bundle.js:21157 Error: [$injector:unpr] Unknown provider: LightboxProvider <- Lightbox <- propertyDamageController
http://errors.angularjs.org/1.4.3/$injector/unpr?p0=LightboxProvider%20%3C-%20Lightbox%20%3C-%20propertyDamageController
    at ionic.bundle.js:8895
    at ionic.bundle.js:13089
    at Object.getService [as get] (ionic.bundle.js:13236)
    at ionic.bundle.js:13094
    at getService (ionic.bundle.js:13236)
    at invoke (ionic.bundle.js:13268)
    at Object.instantiate (ionic.bundle.js:13285)
    at ionic.bundle.js:17841
    at self.appendViewElement (ionic.bundle.js:52255)
    at Object.switcher.render (ionic.bundle.js:50449)

Here is what I inject into my ionic app:

angular.module('starter', ['ionic', 'ionic-material', 'ionic-toast', 'ngCordova','starter.model', 'starter.factory', 'ui.router','ngPDFViewer','ui.bootstrap', 'bootstrapLightbox'])

function propertyDamageController($scope, $state, $cordovaCamera, vehicle, Lightbox) {

vsrboth avatar Apr 10 '16 15:04 vsrboth

How did you install the package?

compact avatar Apr 17 '16 04:04 compact

i got the same error, i installed the package using bower

jemliF avatar Apr 29 '16 12:04 jemliF

minification issue may be (your app.js).

if array of images configured via this,

angular.module('app').config(function (LightboxProvider) {
  LightboxProvider.getImageUrl = function (image) {
    return '/base/dir/' + image.getName();
  };

  LightboxProvider.getImageCaption = function (image) {
    return image.label;
  };
});

Change it to,

angular.module('app').config(['LightboxProvider', function (LightboxProvider) {
   LightboxProvider.getImageUrl = function (image) {
    return '/base/dir/' + image.getName();
  };

  LightboxProvider.getImageCaption = function (image) {
    return image.label;
  };
}]);

abhith avatar May 02 '16 13:05 abhith

Also getting this issue, minification is not the problem. Maybe a conflict of version with angular boostrap lib?

twilly86 avatar May 19 '16 15:05 twilly86

I have the same issue. How to resolve it?

pitometsyurii avatar Oct 27 '16 17:10 pitometsyurii

I have also the same issue, getting this error. Error: [$injector:unpr] Unknown provider: $uibModalProvider <- $uibModal <- Lightbox <- Lightbox

anybody knows solution

farhaan008 avatar Mar 08 '17 10:03 farhaan008