title: Open modal in another controller with ng-include
body: <p>I've this issue when I'm trying to open a modal in AngularJS with phonegap.</p>
  
  <p>I'm checking the connection from device, if device is offline, I need to open a modal.</p>
  
  <p>I have this code on my index.html page: </p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8" &gt;
  
      document.addEventListener("deviceready", onDeviceReady, false);
      function onDeviceReady() {
          var $injector = angular.bootstrap(document, ['sms']);
          var $controller = $injector.get('$controller');
          var scope = $injector.get('$rootScope').$new();
          var DeviceCtrl = $controller("DeviceCtrl", {$scope: scope});
          scope.checkDevice(device.uuid, navigator.network.connection.type);
      }
  
  &lt;/script&gt;
  ...
  
   &lt;div ng-controller="ModalCtrl" ng-include="'app/partials/modals.html'"&gt;
  </code></pre>
  
  <p>That script call <code>checkDevice</code> function on <code>DeviceCtrl</code>. OK at this point.</p>
  
  <pre><code>DeviceCtrl:
  
  function DeviceCtrl($scope, $window, Device, $rootScope) {
  
  $scope.checkDevice = function (deviceUuid, networkState) {
  
      if (networkState == 'none') {
          $rootScope.$broadcast('openConectionless');
      }  
  }
  </code></pre>
  
  <p>And my ModalCtrl:</p>
  
  <pre><code>function ModalCtrl($scope) {
  $scope.$on('openConectionless', function() {
      angular.element("#conectionModal").modal("show");
  
  });
  </code></pre>
  
  <p>}</p>
  
  <p>The <code>openConectionless</code> listener is called, but the <code>angular.element("#conectionModal").modal("show");</code> doesn't affect the modal.</p>
  
  <p>NOTE: If I put the <code>conectionModal</code> div on index.html and call <code>angular.element("#conectionModal").modal("show");</code> on <code>DeviceCtrl</code> instead of <code>$rootScope.$broadcast('openConectionless');</code> , the modal open. 
  But I want to move the modal code to another html to make the code clean. So I create the ModalCtrl.</p>
  
  <p>Does anyone can help me? </p>