Reputation: 6068
I want to display a number of <td>
elements based on the same condition. I am currently doing that with multiple, identical, ng-if
directives, as such:
<tbody>
<tr>
<td> Display unconditionally </td>
<td> Same here... (imagine more columns) </td>
...
<td ng-if='myCondition'> Display based on condition </td>
<td ng-if='myCondition'> And the same </td>
<td ng-if='myCondition'> for plenty of columns </td>
</tr>
</tbody>
While this works one can't help but notice all the repetition. Any ideas on how I could DRY that up?
Upvotes: 30
Views: 18895