title: Optional expression attribute in AngularJS directive
body: <p>I have a custom navigation directive that needs an optional "disable" attribute, and I'm not sure if it's even possible.</p>
  
  <p>In my main controller:</p>
  
  <pre><code>.controller('NavCtrl', ['UserResource','RoleResource'], function(UserResource,RoleResource){
        var user = UserResource.getUser();
        var roles = RoleResource.getRoles();
        UserService.init(user, roles); //????
  
  });
  </code></pre>
  
  <p>In my directive:</p>
  
  <pre><code>.directive('navItem', function(){
      return{
          restrict: 'A',
          scope: {
              text: '@',
              href: '@',
              id: '@',
              disable: '&amp;'
  
          },
          controller: function($scope, $element, $attrs){
              $scope.disabled = ''; //Not sure I even need a controller here
          },
          replace: true,
          link: function(scope, element, attrs){
              scope.$eval(attrs.disable);
          },
          template: '&lt;li class="{{disabled}}"&gt;&lt;a href="{{href}}" id="{{id}}"&gt;{{text}}&lt;/a&gt;&lt;/li&gt;'
  
      }
  
  });
  </code></pre>
  
  <p>In my HTML, I want to do something like this:</p>
  
  <pre><code>&lt;div data-nav-item text="My Text" href="/mytemplate.html" id="idx"
       disable="UserService.hasRole('ADMIN,BILLING') &amp;&amp; someOtherFn(xxx) || ..."&gt;
  </code></pre>