title: Call a method of a controller from another controller using 'scope' in AngularJS
body: <p>I am trying to call a method of second controller in first controller by using <code>scope</code> variable. This is a method in my first controller:</p>
  
  <pre><code>$scope.initRestId = function(){
          var catapp = document.getElementById('SecondApp');
          var catscope = angular.element(catapp).scope();
          catscope.rest_id = $scope.user.username;
          catscope.getMainCategories();
      }; 
  </code></pre>
  
  <p>I am able to set the value of <code>rest_id</code> but I cannot call <code>getMainCategories</code> for some reason. The console shows this error:</p>
  
  <blockquote>
    <p>TypeError: Object # has no method 'getMainCategories'</p>
  </blockquote>
  
  <p>Is there a way to call the above method?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I used the following approach to load two apps at the same time;</p>
  
  <pre><code>angular.bootstrap(document.getElementById('firstAppID'), ['firstApp']);
  angular.bootstrap(document.getElementById('secondAppID'), ['secondApp']);
  </code></pre>
  
  <p>I could definitely use a service here, but I wanted to know if there are any other options to do the same!</p>