为什么“<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
here expected output is no one cell was display but in between <tr>
and <td>
tags <ng-container ng-if="false">
are not working.
如果有人知道这个问题,请寻求解决方案。
尝试将 ng-container 放在 table 行之前
<table>
<ng-container ng-if="false">
<tr>
<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>
</tr>
</ng-container>
</table>
我深入分析了这个问题,我遇到了一些情况
<ng-container ng-if="">
或 <ng-container ng-show="">
或 <ng-container ng-hide="">
条件在 <table>
和 <td>
标签之间不工作,但在 <td>
标签内工作 <ng-container ng-repeat="">
也在工作以上所有标准都很好。
代码:
<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
here expected output is no one cell was display but in between
<tr>
and<td>
tags<ng-container ng-if="false">
are not working.
如果有人知道这个问题,请寻求解决方案。
尝试将 ng-container 放在 table 行之前
<table>
<ng-container ng-if="false">
<tr>
<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>
</tr>
</ng-container>
</table>
我深入分析了这个问题,我遇到了一些情况
<ng-container ng-if="">
或 <ng-container ng-show="">
或 <ng-container ng-hide="">
条件在 <table>
和 <td>
标签之间不工作,但在 <td>
标签内工作 <ng-container ng-repeat="">
也在工作以上所有标准都很好。