-1

I have a html , ng-if start work with multiple tag , i want to apply within attributes

    <td class="text-right" ng-if-start="hascancelData" rowspan="2" ng-if-end>
     <strong>{{cancelData.refundAmount | currency}}</strong>
    </td>

I have to apply rowspan="2" only when hascancelData:true. I have tried ^^

Ravi Ubana
  • 397
  • 5
  • 26
  • 2
    You can't do that, You can try `rowspan="{{hascancelData ? 2 : ''}}"` – Satpal Apr 11 '17 at 09:04
  • Possible duplicate of [What is the best way to conditionally apply attributes in Angular?](http://stackoverflow.com/questions/15696416/what-is-the-best-way-to-conditionally-apply-attributes-in-angular) – Icarus Apr 11 '17 at 09:19
  • No it is not duplicate ng-if start work with multiple tags , i want to apply within attributes – Ravi Ubana Apr 11 '17 at 09:27

2 Answers2

1

You can do something like this:

<td class="text-right" ng-if-start="hascancelData" rowspan="{{hascancelData ? 2 : ''}}" ng-if-end>
Muhammed Neswine
  • 2,028
  • 1
  • 20
  • 20
0

Try this:

<td class="text-right" ng-if="hascancelData" rowspan="{{hascancelData}}?'2':''">
     <strong>{{cancelData.refundAmount | currency}}</strong>
    </td>
Prajwal Bati
  • 185
  • 8
  • 19