Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
Angular2 ng-template documentation and usage

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

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

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.

LIVE DEMO

Documentation link

about 4 years ago · Santiago Trujillo Report

0

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.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!