title: Angular Calling Modal Open function from one controller to another
body: <p>I have a Modal window in my header, with a Click event link in my header to open and close the Modal Window...and this works fine. I.e.</p>
  
  <pre><code>&lt;div class="header" ng-controller="headerCtrl"&gt;
  ...
            &lt;li&gt;&lt;a href ng-click="open()"&gt;Report an Issue&lt;/a&gt;&lt;/li&gt;
  ...
  &lt;/div&gt;
  </code></pre>
  
  <p>and then my controllers</p>
  
  <pre><code> .controller('headerCtrl', ['$location', '$scope', '$log', '$modal', function ($location, $scope, $log, $modal) {
      'use strict';
      (function () {// init
        $scope.open = function (size) {
          var modalInstance = $modal.open({
            templateUrl: 'views/help/supportModalContent.html',
            controller: 'supportInstanceCtrl'
          });
        };
      })();
    }])
  
    .controller('supportInstanceCtrl', ['$location', '$scope', '$log', '$modalInstance','$state', function ($location, $scope, $log, $modalInstance,$state) {
      'use strict';
      (function () {// init
        $scope.ok = function () {
          $modalInstance.close($scope.selected.item);
        };
        $scope.isCollapsed = false;
        $scope.message_sent = false;
      })();
  
      $scope.cancel = function () {
        $modalInstance.dismiss('cancel');
      };
  
      $scope.faq = function () {
        $modalInstance.close('cancel');
        $state.go('faq');
      };
  
      $scope.help = function () {
        $modalInstance.close('cancel');
        $state.go('help');
      };
  
      $scope.send = function () {
        $scope.isCollapsed = true;
        $scope.message_sent = true;
      };
    }])
  </code></pre>
  
  <p>The problem is now in one of my main content view, I now also have a link below which says something click here for support. And I want to open the same modal window again. So I did this</p>
  
  <pre><code>  .controller('noResultCtrl', ['$location','$scope','$log','search','$state','$modal',function ($location,$scope,$log,search,$state,$modal) {
      'use strict';
      $scope.open = function (size) {
        var modalInstance = $modal.open({
          templateUrl: 'views/help/supportModalContent.html',
          controller: 'supportInstanceCtrl'
        });
      };
    }])
  </code></pre>
  
  <p>And it works but is there a better way rather having to put this same logic in every controllers I want to call the same Modal Window in the header ?</p>