Closed gaetansenn closed 8 years ago
PR #25
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', [])
bootstrapLightbox
module depends on both ui.bootstrap.modal
and ui.bootstrap.tpls
, it won't work for apps that don't use ui.bootstrap.tpls
, when a person creates their own templates.bootstrapLightbox
module depends only on ui.bootstrap.modal
, it won't work for apps that need ui.bootstrap.tpls
and don't depend on it or ui.bootstrap
explicitly. There would be errors that the templates template/modal/backdrop.html
and template/modal/window.html
can't be found.bootstrapLightbox
module depends on neither, then it won't work for apps that depend only on bootstrapLightbox
and not ui.bootstrap*
. There would be an error that the $modal
provider does not exist.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).
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