• scope() to get the current scope for the element
  • // get Angular scope from the known DOM element e = document.getElementById(‘myAngularApp’); scope = angular.element(e).scope(); // update the model with a wrap in $apply(fn) which will refresh the view for us scope.$apply(function() { scope.controllerMethod(val); });
  • Angular will stop attaching the scope to the element using jQuery’s .data function.
  • Configuring my app based on angular.element(‘element-X’).scope(); could potentially break the app if we change the scopes around.
  • As I showed in the demo, you can trigger jQuery events when the scope is stored and removed from the global ‘scopes’ object.

I’m using angular to build HTML controls that interact with a legacy Flex application. All callbacks from the Flex app must be attached to the DOM window.

@JavascriptQnA: Call Angular JS from legacy code #javascript #actionscript-3 #externalinterface #angularjs

From within the JS resize function I’d like to dispatch an event that a controller can hear. It seems that creating a service is the way to go. Can you update a service from outside of Angular? Can a controller listen for events from a service? In one experiment (click for fiddle) I did it seems like I can access a service but updating the service’s data doesn’t get reflected in the view (in the example an

should be added to the

RSS Featured Angular Jobs