compact / angular-bootstrap-lightbox

An AngularJS lightbox built using UI Bootstrap Modal.
http://compact.github.io/angular-bootstrap-lightbox/
MIT License
306 stars 134 forks source link

ui.bootstrap dependency #24

Closed gaetansenn closed 8 years ago

gaetansenn commented 8 years ago

I'm currently trying to use your plugin but i have a problem i'm currently using the custom build of ui.bootstrap directly from the repository 'https://github.com/angular-ui/bootstrap' but I have a problem of dependency with your plugin. You are using: 'ui.bootstrap' as dependency but do you really use it ?

angular.module('bootstrapLightbox', [ 'ui.bootstrap' ]);

The problem is that if you are doing custom build of ui.bootstrap the injection is used like : 'ui.bootstrap.modal' and there is no 'ui.bootstrap' so I can't use your plugin.

Regards,

Gaetan SENN

benjamincanac commented 8 years ago

PR #25

compact commented 8 years ago

I was about to release this change, but now I think there is a good reason to have ui.bootstrap as the main module containing all the submodules you need. Here is why.

When I use the Create a Build feature and include only Modal, the generated scripts start with the following.

Build without templates:

angular.module("ui.bootstrap", ["ui.bootstrap.modal"]);
angular.module('ui.bootstrap.modal', [])

Build with templates:

angular.module("ui.bootstrap", ["ui.bootstrap.tpls","ui.bootstrap.modal"]);
angular.module("ui.bootstrap.tpls", ["template/modal/backdrop.html","template/modal/window.html"]);
angular.module('ui.bootstrap.modal', [])
freezy commented 6 years ago

I'm importing component per component from UI Bootstrap and lazy-load them when needed, so there's no ui.bootstrap module and angular-bootstrap-lightbox crashes. I've solved it by defining a dummy module before loading it:

angular.module('ui.bootstrap', []);

It's a bit awkward but it works. @compact your statements above are correct but it's still a bit weird that you would limit the way of packaging the lib in favor of telling users to include UI Bootstrap (it's in the name of the module, duh).