title: AngularJS: I need to update a service from outside of angular
body: <p>I have a service called 'player' and I need to update the service when a flash object is finished loading. </p>
  
  <pre><code>mySongPlayer.factory('player', function() {
  
  var isPlayerLoaded = false;
  var playerHolder = '';
  
  window.playerReady = function(thePlayer) {
      playerHolder = window.document[thePlayer.id];
      addListeners();
      isPlayerLoaded = true;
  }
  
  var flashvars = {
      file:"", 
      autostart:"true",
      skin: "/skins/glow/glow.zip",
  }
  
  var params = {
      allowfullscreen:"false", 
      allowscriptaccess:"always"
  }
  
  var attributes = {
      id:"player1",  
      name:"player1"                    
  }
  
  swfobject.embedSWF("/player.swf", "player_placeholder", "100%", "40", "9.0.115", false, flashvars, params, attributes);
  
  var playObj;
  return playObj || (playObj = {
      currentId: 'test', currentUrl: 'url', playerHolder: ''
  });
  });​
  </code></pre>
  
  <p>I know how to access the service using </p>
  
  <pre><code>angular.element(DOMElement).injector().get('player')
  </code></pre>
  
  <p>but it returns a new instance of 'player' while I need to update the instance already created in the module. Is there a way to do this? I only want one instance of the player, but I need to initialize it from outside javascript.</p>