Hi I'm trying to split the content of a component in two parts and I can't seems to make it work. I know that I can user ng-content
with the attribute select
but I don't know if it's possible to select a number of element with it.
I have this code:
<component-x>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</component-x>
Inside my component-x, I want it to be like this:
<div class="x">
<div class="y">
<ng-content></ng-content>
</div>
<div class="z">
<ng-content select="{{lastXDivs}}"></ng-content>
</div>
</div>
Where lastXDivs equals a number of children.
My result would be like this:
<div class="x">
<div class="y">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
<div class="z">
<div>4</div>
<div>5</div>
</div>
</div>
Is there a way to achieve this?
Note that in my case, the content of divs 1 to 5 are dynamic.
Thanks