角4和ng模板 [英] angular 4 and ng-template

查看:105
本文介绍了角4和ng模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此警告:

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

使用角度4时 发行版会解决这个问题吗?

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

谢谢

推荐答案

您需要注意这一点.您需要修改代码并更改所有出现的

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

<template>

<ng-template>

<template>导致与<template>标记的其他用法发生冲突,因此Angular团队将其更改为将<ng-template>用于Angular.这是一个重大更改,因此他们没有根据语义版本控制规则在Angular2中引入此更改,而只是在Angular4中引入了该更改.

<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.

这篇关于角4和ng模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆