Skip to content
New issue

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

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

Already on GitHub? # to your account

feat(dialog): add elementInjector option to config #70

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

MikeMatusz
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added: n//a
  • Docs have been added / updated: n/a
  • Does this PR introduce a breaking change? N
  • I have linked any related GitHub issues to be closed when this PR is merged? n/a

Describe the new behavior?

As part of the Forge 3.0 migration, the DialogService was switched over to rely entirely on EnvironmentInjector, which limited some ways dependencies could be provided to the dynamically-created component. By allowing an ElementInjector to be provided, createComponent can leverage the local hierarchy directly without having to explicitly copy over all relevant providers, which may not even be known since they could be specified at a higher level.

Additional information

I had initially considered injected the local Injector instance, and defaulting to use that if it differed from the local EnvironmentInjector, implying the service was being provided at the component level. We had done this as a workaround in a few places, but it would interfere with the closeAllDialogs functionality, and there are better alternatives, provided this option is added. A component can provide it's injector directly, or a wrapper service could be provided at the component-level and do the same.

@MikeMatusz MikeMatusz requested a review from a team as a code owner November 13, 2024 18:15
Copy link

stackblitz bot commented Nov 13, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions bot added the minor Increment the minor version when merged label Nov 13, 2024
@DRiFTy17 DRiFTy17 added the skip-release Preserve the current version when merged label Nov 13, 2024
@DRiFTy17 DRiFTy17 merged commit fbcff23 into main Nov 13, 2024
4 checks passed
@DRiFTy17 DRiFTy17 deleted the dialog-service-injector branch November 13, 2024 18:30
Copy link
Contributor

🚀 PR was released in v4.2.0 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Nov 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
minor Increment the minor version when merged released This issue/pull request has been released. skip-release Preserve the current version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants