Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

227
Vistas
angular 4 and ng-template

I'm getting this warning:

The <template> element is deprecated. Use <ng-template> instead ("
        [attr.tabIndex]="-1"
        [ngClass]="{'k-item': true}">
        [WARNING ->]<template *ngIf="template"
            [templateContext]="{

when using angular 4, is this being taken care of for the release version?

thanks

about 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

You need to take care of that. You need to modify your code and change all occurences of

<template>

to

<ng-template>

<template> caused conflicts with other usages of the <template> tag, therefore the Angular team changed it to use <ng-template> for Angular purposes. It's a breaking change, therefore they didn't introduce this change in Angular2 but only in Angular4 according to semantic versioning rules.

about 4 years ago · Santiago Trujillo Denunciar

0

ng-template in angular 4 can be used as-

<div *ngIf="isValid; else notValidCondition">
     Welcome User
</div>

<ng-template #notValidCondition>Good Bye</ng-template>
about 4 years ago · Santiago Trujillo Denunciar

0

Simply use <ng-template>, <template> is deleted from Angular 4 as it's too generic and create some name conflict, now Angular team decided have everything start with ng as it was and should be.

Also can use if else in the new templating, look at the simple example below:

<ng-template #laoding>
  <p>Loading...</p>
</ng-template>
<p *ngIf="auth | async; else laoding; let user">
  {{user.username }}
</p>
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda