I need to dynamically display a table in Angular, depending on the info coming from the DB
So far, I have this Info
[ { "BET": 57630343, "CUSTOMER": 181645, "XX_FILL OPEN": true },
{ "BET": 57633044, "CUSTOMER": 181645, "XX_FILL OPEN": true },
{ "BET": 57633047, "CUSTOMER": 181645, "XX_FILL OPEN": true },
{ "BET": 57635034, "CUSTOMER": 181645, "XX_FILL OPEN": true } ]
everything with XX... should be a button
and in the HTML
<table>
<thead>
<tr>
<th>Bet</th>
<th>Customer</th>
<th>Fill Open Bet</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="pendingBet in pendingBets">
<td> {{::pendingBet.BET}}</td>
<td> {{::pendingBet.CUSTOMER}}</td>
<td><button class="btn btn-danger">Fill</button></td> <!--{{pendingBet.XX_FILL_OPEN}}-->
</tr>
</tbody>
</table>
the issue I have here is: above I have something static like
<th>Bet</th>
<th>Customer</th>
<th>Fill Open Bet</th>
but sometimes <th>Bet</th> which is <td> {{::pendingBet.BET}}</td> is not coming from the DB, so I don't have to display it, so I want to know what should I do to display it dynamically
what should I do in this case?
EDIT
Let explain myself better:
according to the table, <td> {{::pendingBet.BET}}</td> belongs to <th>Bet</th>, but sometimes pendingBet.BET is null so I don't have to display all that column <th>Bet</th> and <td> {{::pendingBet.BET}}</td>, the same with Customer and Fill Open.
pendingBet.BET?BET, orCUSTOMERor the other are not coming from the DB, then I should not display that row neither the header.ng-ifon the<tr>for that. Or filter the data first in controller<tr>? is doesn't make any sense, if I apply to the whole<tr>, then when BET isn't coming, nothing will show up.