title: Monitor global variable from AngularJS
body: <p>I want to constantly monitor the value of a global variable from Angular.
  I have a flash movie which records microphone data and pushes this out to the global variable.
  I reference this variable from Angular like this:</p>
  
  <pre><code>$scope.audioData = $window.audioData;
  $scope.$watch('audioData', function() {
      console.log("audio in angular!:", $scope.audioData.length);
  });
  </code></pre>
  
  <p>and in the HTML I've put:</p>
  
  <pre><code>&lt;h1&gt;{{audioData.length}}&lt;/h1&gt;
  </code></pre>
  
  <p>In the HTML I can see that the audio data is changed after I recorded, but the watch function is not being called <strong>while</strong> it's recording, which I need to stream the audio to a server.</p>