title: has-authority not working on a button
body: <p>So I used JHipster to generate my app. </p>
  
  <p>I could see the navbar using the <code>has-authority</code> directive to show/hide menus.</p>
  
  <p>Now what I would to do is to use the directive on a button to show it only to users with <code>ROLE_ADMIN</code> </p>
  
  <p>here's the code of the directive </p>
  
  <pre><code>.directive('hasAuthority', ['Principal', function (Principal) {
      return {
          restrict: 'A',
          link: function (scope, element, attrs) {
              var setVisible = function () {
                      element.removeClass('hidden');
                  },
                  setHidden = function () {
                      element.addClass('hidden');
                  },
                  defineVisibility = function (reset) {
  
                      if (reset) {
                          setVisible();
                      }
  
                      Principal.hasAuthority(authority)
                          .then(function (result) {
                              if (result) {
                                  setVisible();
                              } else {
                                  setHidden();
                              }
                          });
                  },
                  authority = attrs.hasAuthority.replace(/\s+/g, '');
  
              if (authority.length &gt; 0) {
                  defineVisibility(true);
  
                  scope.$watch(function(scope) {
                      return Principal.isAuthenticated();
                  }, function(newValue) {
                      defineVisibility(true);
                  });
              }
          }
      };
  }]);
  </code></pre>
  
  <p>here's where it's working</p>
  
  <pre><code>&lt;li ng-class="{active: $state.includes('admin')}"  ng-switch-when="true" has-authority="ROLE_ADMIN" class="dropdown pointer"&gt;
  </code></pre>
  
  <p>and here is where I want it to work </p>
  
  <pre><code>&lt;table class="jh-table table table-striped"&gt;
      &lt;thead&gt;
          ...
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr
              ng-repeat="offeredService in travelRequest.offeredServices track by offeredService.id"&gt;
              &lt;td&gt;&lt;a
                  ui-sref="offeredServiceType.detail({id:offeredService.offeredServiceType.id})"&gt;{{offeredService.offeredServiceType.name}}&lt;/a&gt;
              &lt;/td&gt;
              &lt;td&gt;{{offeredService.sellingPrice}}
                  {{offeredService.currency.symbol}}&lt;/td&gt;
              &lt;td&gt;{{offeredService.cost}}
                  {{offeredService.currency.symbol}}&lt;/td&gt;
              &lt;td&gt;{{offeredService.confirmationDate | date:'medium'}}&lt;/td&gt;
              &lt;td&gt;&lt;a
                  ui-sref="serviceProvider.detail({id:offeredService.serviceProvider.id})"&gt;{{offeredService.serviceProvider.name}}&lt;/a&gt;
              &lt;/td&gt;
              &lt;td class="text-right"&gt;
                  &lt;div class="btn-group flex-btn-group-container"&gt;
                      &lt;button type="submit"
                          ui-sref="offeredService.detail({id:offeredService.id})"
                          class="btn btn-info btn-sm"&gt;
                          &lt;span class="glyphicon glyphicon-eye-open"&gt;&lt;/span&gt; &lt;span
                              class="hidden-xs hidden-sm" translate="entity.action.view"&gt;&lt;/span&gt;
                      &lt;/button&gt;
                      &lt;button type="submit"
                          ui-sref="offeredService.edit({id:offeredService.id})"
                          class="btn btn-primary btn-sm"&gt;
                          &lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt; &lt;span
                              class="hidden-xs hidden-sm" translate="entity.action.edit"&gt;&lt;/span&gt;
                      &lt;/button&gt;
                      &lt;button has-authority="ROLE_USER" type="submit"
                          ui-sref="offeredService.delete({id:offeredService.id})"
                          class="btn btn-danger btn-sm"&gt;
                          &lt;span class="glyphicon glyphicon-remove-circle"&gt;&lt;/span&gt; &lt;span
                              class="hidden-xs hidden-sm" translate="entity.action.delete"&gt;&lt;/span&gt;
                      &lt;/button&gt;
                  &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>