Content Projection

What is Content projection(ng content) and why we should use this?

In simple word the goal of ng-content or Content projection is to create reusable component.
For example we have five bootstrap cards in a page all cards have header ,body and footer the only difference is header and body data but the structure is same if can easily do this without ng-content but you can think why we need this because the reason is we can also change the position of section with ng-content without ng-content you can not do this. This post also cover how we can use input decorator to pass data from parent to children or how we can create reusable component. Demo Githuhub Stackbiz

Leave a Reply

Your email address will not be published. Required fields are marked *