angular-bootstrap-lightbox
angular-bootstrap-lightbox copied to clipboard
Unknown provider: LightboxProvider <- Lightbox
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) {
How did you install the package?
i got the same error, i installed the package using bower
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;
};
}]);
Also getting this issue, minification is not the problem. Maybe a conflict of version with angular boostrap lib?
I have the same issue. How to resolve it?
I have also the same issue, getting this error. Error: [$injector:unpr] Unknown provider: $uibModalProvider <- $uibModal <- Lightbox <- Lightbox
anybody knows solution