I have an angular 2 component (my-panel) that will display the supplied content using ng-content. I also want to display that same content in an expanded modal, however it appears that I can only reference ng-content once in the template.
Is it possible to reference the panel content more than once in the template, thus avoiding the need to pass the same content more than once and needing to specifically reference each using selectors with ng-content?
Thanks in advance.
my-panel template:
<div class="panel panel-default">
<!-- non-expanded panel -->
<div class="panel-body">
<ng-content></ng-content>
</div>
<button data-toggle="modal" data-target="#myModal">Expand</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<ng-content></ng-content> <-- content not displayed
</div>
</div>
</div>
</div>
</div>
desired my-panel usage:
<my-panel>
<p>my panel content</p>
</my-panel>