0

I have declared a variable called authenticated that I want to use to show or hide a button in a popover. The user should only see the button if he has already authenticated.

I tried the ng-if with the variable in the h5 part and here it works. I think it is just the formatting inside the string for data-content because when I inspect the page it doesn't use the ng-if but it shows it in the source code.

<span ng-switch-when="null"
    class="redbox label label-primary {{types[charge.Type].CSS}}"
    style="cursor:pointer;"
    onclick="$(this).popover('toggle')"
    data-html='true'
    data-toggle="popover"
    data-trigger="manual"
    data-placement="top"
    title="{{&quot;common.BatchStatus-NotPaired&quot;|i18n}}"
    data-content="{{ getPopoverTemplate(charge) }}
        <a href='#/delete-batch?id={{charge._id}}' class='btn btn-primary btn-block' ng-if='authenticated'><span>{{&quot;common.Delete-Batch&quot;|i18n}}</span></a>">
  <h5 ng-if='authenticated'><strong>{{charge.LogicalId}} ({{charge.RfidNullCounter}})</strong></h5>
</span>
JSON C11
  • 11,272
  • 7
  • 78
  • 65
IAmRoot
  • 1
  • 7

0 Answers0