Skip to content
Advertisement

In Angular 14, how do I include a child component in a standalone component?

I’m using Angular 14. I have a standalone component in which I want to include a child component from another module. The standalone component looks like

JavaScript

and its service file is

JavaScript

The child component is in another module — MyModule. The my.module.ts file looks like

JavaScript

But my parent’s HTML is giving me the error on the

JavaScript

line …

JavaScript

Advertisement

Answer

Try to export ChildComponent from the MyModule, so you can use it somewhere else:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement