0

I have a component that is declared in app.module.ts. It is in the declarations array. I also have a feature module. I'm trying to use the component that was declared in app.module.ts in my feature module but am getting some errors related to no value accessor for form control.

When I take the component that is declared in app.module.ts and put it in a shared module and import the shared module to my feature module, everything works fine.

The simple solution is probably to take all my shared components and put them into a shared module, however I am wondering if there is a way for me to not have to do that. I understand it may be a best practice but I would like to know if there is a way to have a component declared in app.module.ts and used in a feature module without having the component in its own shared module.

1 Answer 1

2

As you said the only way you could do that is using a shared module. Something you can do to not use a shared module is to export this component in app module and then import app module to your feature module. Or you should also work with the routing module, importing your component and make it works.

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

1 Comment

Thanks for the reply. I'm going to try to work with the gatekeeper of this code to get it put into a shared module.

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.