Angular Event Listener

Hey. I’m trying to follow some of the suggestions here to make AJAX calls inside a simple Text Panel.

I’ve almost got it entirely working however I want to subscribe to the data-received event for when a refresh happens. Here is what I’ve got:

angular.element('#processStatus').injector().get('$rootScope').$on('data-received', function() {

Where #processStatus is a div that wraps my code and has the class “ng-scope” on it. Unfortunately I never receive the data-received event (or refresh as in the original github issue). Any suggestions?