Here is the stackblitz code.
As you can see
-
You cannot do this, without two loops. The reason being ng-content is a placeholder, which accepts dynamic html inside. Now when you loop inside your code, you don't assign anything to the even or odd selector. But if you change your code to below
{{number}}
{{number}}
You will see the output change to
This is because no the output of ng-For has been assigned to the even selector.
If you change the template to below
{{number}}
{{number}}
It will work
Also remember inside a ng-For you cannot append content to a even or odd section, even if that feature was available it would have overwritten the section with the last value.
Leaving even ng-for out of it. The below code
This should be under odd
Also won't work
So what you are trying to achieve and the way you are trying to achieve it is not supported by angular.