Skip to content

Modified the Dependency Injectection for lazy-loaded modules#476

Open
shaswat94 wants to merge 2 commits intoswimlane:masterfrom
shaswat94:swarup94-bugfix
Open

Modified the Dependency Injectection for lazy-loaded modules#476
shaswat94 wants to merge 2 commits intoswimlane:masterfrom
shaswat94:swarup94-bugfix

Conversation

@shaswat94
Copy link
Copy Markdown

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
Currently, getting the following error while trying to lazily load NgxModule:

ERROR NullInjectorError: R3InjectorError(AppModule)[LayoutService -> LayoutService -> LayoutService]:
NullInjectorError: No provider for LayoutService!
In order to try to solve the problem, i tried instanciating the service by myself, but
Module not found: Error: Package path ./lib/graph/layouts/layout.service is not exported from package

What is the new behavior?
Lazily loads without any exception.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

for lazy-loaded modules
@cfrezier
Copy link
Copy Markdown

I think that it would be ok.
If I can, I'll change the providedIn: any to providedIn: root because the other one seems deprecated now.

@shaswat94
Copy link
Copy Markdown
Author

@assafsun, @marjan-georgiev, Please merge the PR after review.

@shaswat94
Copy link
Copy Markdown
Author

@assafsun, @marjan-georgiev, Any updates?

@preethampoonacha
Copy link
Copy Markdown

@cfrezier @marjan-georgiev @assafsun
Can we go ahead with this merge, layoutService needs to be global inject for lazy loading.

@Shaswat-Swarup-Maersk
Copy link
Copy Markdown

@cfrezier @marjan-georgiev @assafsun Can we go ahead with this merge, layoutService needs to be global inject for lazy loading.

Are you still waiting for a reply dude 😆

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants