title: Access Angular object's function from outside JS
body: <p>I'm building a HTML-app with the AngularJS framework. I have some legacy JavaScript actions that needs to access a function within the Angular-object, and I can't get it to work.<br>
  This is the Angular-object (function I need to access is the <code>$scope.info()</code>):</p>
  
  <pre><code>function content($scope) {
      $scope.info = function (id) {
          console.log('Got a call from '+id);
          $scope.text = "Hello, "+id;
      };
  }
  </code></pre>
  
  <p>I have attempted to access it through <code>angular.element('content').scope().info('me')</code>, but with no result (console says <code>undefined</code>). I attempted to dump the result of <code>angular.element('content').scope()</code>, and I got the full object list and everything. Theoretically, my first example should work, however it does not.</p>
  
  <p>Any guidance as to how I can achieve this is much appreciated!<br>
  <sub><sup>(PS: <a href="https://stackoverflow.com/q/10490570/267892">Call Angular JS from legacy code</a> did not resolve this).</sup></sub></p>
  
  <hr>
  
  <p>When I was finally able to access the function, it didn't work as expected – the value of <code>$scope.text</code> is <em>technically</em> modified, but the expressions used in the HTML are not updated! For example, <code>&lt;p&gt;{{text}}&lt;/p&gt;</code>does not get updated after this function is called from an external function.</p>
  
  <p>Is there any way to fix this?</p>