Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modals and lazy-loaded NgbModule #784

Closed
pkozlowski-opensource opened this issue Sep 22, 2016 · 3 comments
Closed

Modals and lazy-loaded NgbModule #784

pkozlowski-opensource opened this issue Sep 22, 2016 · 3 comments

Comments

@pkozlowski-opensource
Copy link
Member

Ref: http://stackoverflow.com/questions/39629827/opening-a-modal-from-a-lazy-loaded-module

We need to investigate / fix (if there is anything to fix).

@k-schneider
Copy link
Contributor

Thanks for opening this!

I think the root of the problem is that the NgbModal service is intended to be an app-wide singleton?

Providers imported in lazy loaded modules are always new instances. The NgModules documentation covers this topic nicely.

I'm just not sure what the correct way of configuring a lazy loaded module would be.. If I need to import NgbModule in the lazy loaded module to have access to the component directives then it will also be importing a separate instance of the NgbModal service.

Thanks again.

@k-schneider
Copy link
Contributor

The Material2 team ran into a similar issue with one of their services. A good discussion and solution is available here:

angular/components#1071

@pkozlowski-opensource
Copy link
Member Author

@k-schneider Yes. PRs welcomed.

@pkozlowski-opensource pkozlowski-opensource added this to the alpha.7 milestone Sep 23, 2016
k-schneider pushed a commit to k-schneider/ng-bootstrap that referenced this issue Sep 26, 2016
BREAKING CHANGE: The root app module must now import using the forRoot() static method.

Closes ng-bootstrap#784
k-schneider added a commit to k-schneider/ng-bootstrap that referenced this issue Sep 26, 2016
BREAKING CHANGE: The root app module must now import using the forRoot() static method.

Closes ng-bootstrap#784
k-schneider added a commit to k-schneider/ng-bootstrap that referenced this issue Sep 26, 2016
BREAKING CHANGE: The root app module must now import using the forRoot() static method.

Closes ng-bootstrap#784
k-schneider added a commit to k-schneider/ng-bootstrap that referenced this issue Sep 27, 2016
BREAKING CHANGE: The root app module must now import using the forRoot() static method.

Closes ng-bootstrap#784
Foxandxss pushed a commit that referenced this issue Sep 29, 2016
BREAKING CHANGE: The root app module must now import using the forRoot() static method.

Closes #784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants