为什么“< ng-container>"不能在“< tr>"中工作标签 [英] why "<ng-container> not working in "<tr>" tag

查看:62
本文介绍了为什么“< ng-container>"不能在“< tr>"中工作标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码:

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

这篇关于为什么“&lt; ng-container&gt;"不能在“&lt; tr&gt;"中工作标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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