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

feat(modal): add injector option #1685

Closed
wants to merge 1 commit into from

Conversation

matt-duch
Copy link
Contributor

I have an application whose components depend heavily on scoped providers, which makes it difficult to reuse those components within a modal. This has also come up on stack overflow (we do something similar with a reflective injector):
https://stackoverflow.com/questions/42568336/how-to-open-a-component-in-ng-bootstrap-modal-using-a-specific-injector

We made a small change: add a property 'injector: Injector' to NgbModalOptions and use that within NgbModalStack.open
this._getContentRef(moduleCFR, contentInjector, content, activeModal);
-->
this._getContentRef(moduleCFR, options.injector || contentInjector, content, activeModal);

@pkozlowski-opensource
Copy link
Member

LGTM. This change makes sense, I wanted to add it at some point but wanted to wait till someone comes up with a real-life use-case.

Merging, thnx!

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

Successfully merging this pull request may close these issues.

None yet

2 participants