I updated my project to the latest angular2 4.0.0-rc.5 and upon building it spits a lot of warnings like this:
Template parse warnings:
The <template> element is deprecated. Use <ng-template> instead ("_newGroupReward.group.description}}
My question is - what is and where can I find info about it and how to use it ? I have been googling however the only doc I could find is about the stable 2.4.x versions ( official docs ).
Best regards
Santiago Trujillo
ngTemplate is a replacement for template, It is used when a sample template should be injected into the DOM.
The below example is illustrated with using ngIf else
as below,
<ng-template #loading>Failed to do something wrong...</ng-template>
<div *ngIf="userObservable;else loading;">
Aravind is here
</div>
When I am using loading, angular calls the TemplateRef with the name as loading
denoted by #loading
and respective template is replaced inside the div.
I found this reference. It may be helpful.
https://toddmotto.com/angular-ngfor-template-element
Update:
I was having the same issue. I fixed it by replacing the ng-template with ng-container . Take a look to the official docs for more details.