Below you will find pages that utilize the taxonomy term “ng-content”
Posts
Render children in an Angular wrapper component using ng-content
In my past experience with React, I have always used props.children to render children inside a wrapper or style component. It would look something like this:
// Wrapper component: function WrapperComponent(props) { return <div class="wrapper">{{ props.children }}</div> } // Usage: function AppComponent() { return <WrapperComponent><div id="child">I'm a child</div></Wrapper> } Now, as I’m working with Angular, I needed to do the same thing. However, I could never find the correct way to do it.