【发布时间】:2017-10-03 14:44:07
【问题描述】:
为什么这不起作用?我在浏览器控制台中收到“tr”的未闭合标签错误。
Error: Template parse errors:
Unexpected closing tag "tr". It may happen when the tag has already been closed by another tag.
但据我所知,应该没有未闭合的标签。 我一开始就打开tr,最后关闭它。所以 ngIf 中的 close-open 在任何情况下都应该起作用。
import {Component} from '@angular/core';
@Component({
selector: "parent",
template: `
<table border=1>
<tr>
<ng-container *ngFor="let k of [1,2,3,4]">
<td>test</td>
<ng-container *ngIf="true">
</tr><tr>
</ng-container>
</ng-container>
</tr>
</table>
`
})
export class ParentComponent {}
感谢您的帮助!
【问题讨论】:
标签: javascript angular typescript angular2-template