2

Code:

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

OutPut:

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.

If anyone idea about this problem please get solution.

Pradip Talaviya
  • 399
  • 2
  • 8
  • 22

2 Answers2

2

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.

nativegrip
  • 892
  • 10
  • 20
1

Try to put ng-container before table row

<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>
Ravi Ubana
  • 397
  • 5
  • 26