title: Binding AngularJS with JavaScript Plugin
body: <p>I'm trying to bind AngularJS with JavaScript Plugin - OpenSeaDragon, because I have to do annotations on OpenSeaDragon's image and I tried something like this</p>
  
  <pre><code>angular.element(document.body).scope().$on('addAnnotation', function(e, data){    
      self._viewer.viewport.fitBounds(new OpenSeadragon.Rect(data)) 
  });
  </code></pre>
  
  <p>And inside the controller:</p>
  
  <pre><code>$scope.addAnnotation= function (data) { 
     $scope.$root.$emit('addAnnotation', data);
  }
  </code></pre>
  
  <p>And in my view:</p>
  
  <pre><code>ng-click="addAnnotation(data)"
  </code></pre>
  
  <p>but I am getting error </p>
  
  <pre><code>Uncaught TypeError: Cannot read property '$on' of undefined
  </code></pre>