Essentially, in the template of component 1, I have something like this:
<div>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</div>
Then in the template of component 2 (which is a sibling of component 1), I have the following:
<div class="test">
<h1>component 2</h1>
</div>
What I am aiming for is that when a specific variable in component 2, let's say "toggled" equals true, the template of component 2 should change to include the list from component 1.
<div class="test">
<h1>component 2</h1>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</div>
I am working with Angular version 4.0.0 and I came across information about templateoutlet, but I couldn't quite grasp how to share it between different components. Is there a way to duplicate a template fragment from one component and use it in another component?