title: AngularJS Directives check for flag
body: <p>I would have a question to angularJS directives. 
  I have the following directive- Code: </p>
  
  <pre><code>&lt;div class="panel panel-primary"&gt;
      &lt;div class="panel-heading"&gt;
          &lt;h3 class="panel-title"&gt;
              &lt;div class="badge pull-right" tooltip="Role" tooltip-append-to-body="true" editable-text="vm.mytext"&gt;{{vm.mytext}}&lt;/div&gt;
  ...
  </code></pre>
  
  <p>and in this code there is </p>
  
  <blockquote>
    <p>editable-text="vm.mytext"</p>
  </blockquote>
  
  <p>but I use the directive a lot of times an I don't need to edit the </p>
  
  <blockquote>
    <p>... div class="badge pull-right" tooltip="Role" ...</p>
  </blockquote>
  
  <p>every time. I use the directive like this: </p>
  
  <pre><code>&lt;div ng-repeat="item in items"&gt;
      &lt;as-directive-name item="item"&gt;&lt;/as-directive-name&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My question now would be if it is possible to user the directive like this: </p>
  
  <pre><code>&lt;div ng-repeat="item in items"&gt;
      &lt;as-directive-name item="item" roleEditable="false"&gt;&lt;/as-directive-name&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Is there a possibility to assign a flag roleEditable and to check this flag in the directive-html similarly to this: </p>
  
  <pre><code>&lt;div class="panel panel-primary"&gt;
  &lt;div class="panel-heading"&gt;
      &lt;h3 class="panel-title"&gt;
          &lt;div class="badge pull-right" tooltip="Role" tooltip-append-to-body="true" if(roleEditable == true) {editable-text="vm.mytext"}&gt;{{vm.mytext}}&lt;/div&gt;
  </code></pre>
  
  <p>Thanks a lot for help!
  All the best!</p>
  
  <p><strong>[EDIT]</strong>
  Here is the code of the directive:</p>
  
  <pre><code>(function() {
  'use strict';
  
  angular
      .module('myproject.institution')
      .directive('asInstitutionPanel', asInstitutionPanel);
  
  function asInstitutionPanel() {
      var directive = {
          restrict: 'E',
          replace: true,
          scope: {
              asInstitutionUserConnection: '='  
          },
          controller: InstitutionPanelController,
          controllerAs: 'vm',
          bindToController: true,
          templateUrl: 'app/... .directive.html'
      };
  
      return directive;
  }
  
  InstitutionPanelController.$inject = ['$scope'];
  
  function InstitutionPanelController($scope) {
      $scope.vm = this; // assumes controllerAs: vm
      var vm = this;
      vm.institutionUserConnection = this.asInstitutionUserConnection;
  }
  })();
  </code></pre>