How Can I Pass In Generic HTML To An Angular 2 Component?
I want to make a generic modal component that can hold anything, from just text to images/buttons etc. If I do something like this:
and you may pass any HTML content directly into your component.
Lets say your component name is my-modal
, you may use it like below,
<my-modal>
<<HTML content : this will be replaced in the ng-content area >>
</my-modal>
Hope this helps!!
Post a Comment for "How Can I Pass In Generic HTML To An Angular 2 Component?"