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:
$scope.audioData = $window.audioData;
$scope.$watch('audioData', function() {
console.log("audio in angular!:", $scope.audioData.length);
});
and in the HTML I've put:
<h1>{{audioData.length}}</h1>
In the HTML I can see that the audio data is changed after I recorded, but the watch function is not being called while it's recording, which I need to stream the audio to a server.
audioData.length, or use the third parameter to$watch.$applysomewhere.