title: Angularjs call directive in another controller
body: <pre><code>    abcModule.directive('resize', function ($window) {
          return function (scope, element) {alert('ad');
          var w = angular.element($window);
          scope.getWindowDimensions = function () {
              return { 'h': w.height(), 'w': w.width() };
  
          };
          scope.$watch(scope.getWindowDimensions, function (newValue, oldValue) {
              scope.windowHeight = newValue.h;
             //scope.windowWidth = newValue.w;
            // alert('cal');
              scope.wrapHeight = $('#wrapper').height();
              scope.calcHeight = scope.windowHeight - scope.wrapHeight;           
              if(scope.calcHeight &gt; 80){
                  scope.isScroll = false;
              }
              else{
                  scope.isScroll = true;
              }
              scope.style = function () {
                  return { 
                      'height': (newValue.h - 100) + 'px',
                      //'width': (newValue.w - 100) + 'px' 
                  };
              };
  
          }, true);
          w.bind('resize', function () {
              scope.$apply();
          });
      }
  })
  </code></pre>
  
  <p>Now i would like to call above resize method inside a another function based on certain condition, Can anyone help me on this ???</p>