为什么“< ng-container>"不能在“< tr>"中工作标签 [英] why "<ng-container> not working in "<tr>" tag
问题描述
代码:
<table>
<tr>
<ng-container ng-if="false"> // here ng-container not working
<td>
<ng-container ng-if="false">abc</ng-container>// here ng-container working fine
</td>
<td><ng-container ng-if="true">xyz</ng-container></td>
</ng-container>
</tr>
</table>
输出:
xyz
这里没有显示预期的输出,但是在
<tr>
和<td>
标签之间<ng-container ng-if="false">
不起作用.
here expected output is no one cell was display but in between
<tr>
and<td>
tags<ng-container ng-if="false">
are not working.
如果有人对这个问题有想法,请寻求解决方案.
If anyone idea about this problem please get solution.
推荐答案
我对此问题进行了深入分析,并且遇到了类似的情况
在所有条件下,<ng-container ng-if="">
或<ng-container ng-show="">
或<ng-container ng-hide="">
条件在<table>
和<td>
标记之间不起作用,但在<td>
标记内部也起作用,仍然可以正常工作.
I analysis this issue in deep and i faced some situation like
<ng-container ng-if="">
or <ng-container ng-show="">
or <ng-container ng-hide="">
conditions not working between <table>
and <td>
tag but working inside <td>
tag also <ng-container ng-repeat="">
is working fine in above all criteria.
这篇关于为什么“< ng-container>"不能在“< tr>"中工作标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!