title: Injecting dependencies into controllers - angularjs
body: <p>I am using the $modal service to invoke a controller and its respective template. it looks something like this :</p>
  
  <pre><code>$modal.open({
    templateUrl: 'someTemplate.tpl.html'
    controller: 'MyController',
    resolve: {
      variable1: function() {return data1;},
      variable2: function() {return data2;}
    }    
  });
  </code></pre>
  
  <p>The point is when MyController is invoked variable1 and variable2 are resolved and passed into this controller</p>
  
  <p>I now need to call this controller from elsewhere in the code (not via $modal service). How to I inject variable1 and variable2 in this case ?</p>