so there is something call ng-container also,
ng-container and ng-template Both of them are at the moment (2.x, 4.x)
used to group elements together without having to introduce another
element which will be rendered on the page (such as div or span).
the difference between ng-template and ng-container is
ng-template is used for a structural directive like ng-if, ng-for and ng-switch. If you use it without the structural directive, nothing happens and renders.
ng-container is used when you don't have a suitable wrapper or parent container. In most cases, we are using div or span as a container but in such cases when you want to use multiple structural directives, but you can't use more than one structural directive on an element, in that case, ng-container can be used as a container
in your case
<ng-template>
is used to declare a template. What you want here is to hide/display some nodes
so you need to use ng-container for the same like
<tr *ngFor="let item of items">
<ng-container *ngIf="item.month == 12">
<td>{{ item.year }}</td>
<td>{{ item.month }}</td>
</ng-container>
</tr>
there are couple of links which will help you to understand the both
related link
structural directives
discussion on ng-template and ng-container