title: Access $scope from $rootScope by invoking the method defined in the $rootScope?
body: <p>I have a method defined on the $rootScope</p>
  
  <pre><code>$rootScope.method = function(value){
      // wanna give this value to `$scope.value` below:
  };
  </code></pre>
  
  <p>And I invoke it from an entirely another $scope</p>
  
  <pre><code>app.controller('some', function($scope){
      $scope.value = null;    
  });
  </code></pre>
  
  
  
  <pre><code>&lt;div ng-controller="some"&gt;
      &lt;input ng-model="value"&gt;
      &lt;button ng-click="method(value)" &gt;Click&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Is it possible (and if so, how?) to access the localized $scope from the method defined on $rootScope and alter its property?</p>
  
  <p>I thought <code>this</code> will work <strike>but it doesn't</strike></p>
  
  <pre><code>$rootScope.method = function(value){
      this.value = value // "this" is not the $scope
  };
  </code></pre>
  
  <hr>
  
  <p><strong>edit</strong>: Actually it does work. Just found out after I added this demo script that it does indeed work as I hoped</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>angular.module('app', [])
    .controller('main', function($rootScope) {
      $rootScope.method = function(value) {
        this.changedValue = 'changed ' + value;
      }
    })
    .controller('some', function($scope) {
      // $scope.changedValue = 'not working';
    })
    .controller('someOther', function($scope) {
      $scope.changedValue = 'this should not change';
    });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;div ng-app="app"&gt;
    &lt;div ng-controller="main"&gt;
    &lt;/div&gt;
    &lt;div ng-controller="some"&gt;
      &lt;input ng-model="value"&gt;&lt;/input&gt;
      &lt;button ng-click="method(value)"&gt;Click&lt;/button&gt;
      {{changedValue}}
    &lt;/div&gt;
    &lt;div ng-controller="someOther"&gt;
      {{changedValue}}
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>