title: Dynamically disable tooltip when element becomes disabled
body: <p>I am trying to prevent a twitter bootstrap tooltip from showing when the element is disabled. I am able to do so with the following code: </p>
  
  <pre><code>app.directive("tooltip",function(){
      return {
            restrict:"A",
            require: 'tooltipDirection',
            link:function(scope,element,attrs,directionController){
  
                 attrs.$observe('ngDisabled',function(){
  
  
                     console.log("ngDisabled has changed: " + attrs.ngDisabled);
  
                 });                  
  
                 if(scope.$eval(attrs.ngDisabled)!=true){
  
                   $(element).attr('title',attrs.tooltip).tooltip({placement:directionController.direction});
                 }
             }
       };
  
  });
  </code></pre>
  
  <p>However, this only works when the page loads and the element is already disabled. I need a way of dynamically disabling the tooltip. For example, if I click on a button (edit) which changes the value of a scope variable(editing_bln), the 2nd button button (save) becomes disabled via ngDisabled and the scope variable, editing_bln. I now want the tooltip to be disabled as well - which it is not. I tried using attrs.$observe in the link function, however, that is also getting called when the page loads and not when the variable, editing_bln, changes. Here is the button code:</p>
  
  <pre><code>&lt;button type="button" ng-class="{'btn-danger':editing_bln}" class="btn btn-mini" style="margin-top:10px;margin-left:20px;" ng-click="editing_bln = !editing_bln"&gt;&lt;i tooltip-direction="top" tooltip="Click to Edit Content" ng-class="{'icon-white':editing_bln}" class="icon-pencil"&gt;&lt;/i&gt;&lt;/button&gt;
  
  &lt;button ng-disabled="editing_bln" type="button" class="btn btn-mini" style="margin-top:10px;" ng-click="responseAdd()"&gt;&lt;i tooltip-direction="top" tooltip="Add response to group."  class="icon-plus"&gt;&lt;/i&gt;&lt;/button&gt;
  </code></pre>
  
  <p>I am guessing that I am missing the mark in the linking function. Thanks for any and all replies.</p>