0

I has LazyModule which I load lazy, and another one ModuleA. I need to use component Module-A-Component inside LazyModule. How can I access this external component? I use Module-A-Component around all application.

If I add Module-A-Component in daclaration array of LazyModule got the error:

Module-A-Component is part of the declarations of 2 modules...

If I move Module-A-Component only in LazyModule I can't use it in other parts of application.

How can I use the external component in lazy loaded module and other modules?

1
  • would you mind accepting or rejecting the answer . That would help me improve or remove an unwanted answer from SO Commented May 17, 2022 at 6:23

1 Answer 1

1

Since there is no code, so I am gonna give a theoretical answer. You need to create a shared-module. Create Module-A-Component inside it and name it accordingly. Then reuse it in MOdule A , MOdule-B and so on.

This will also make sure that there are no circular dependecy.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.