title: How to call a factory method dynamically coming from variable?
body: <p>I have a service which will return the name of factory. I already injected all the factories into controller. I need to use the variable to call the method inside that factory. I know i can use</p>
  
  <pre><code>if(var == 'factoryname') {
       factoryname.method()
  }
  </code></pre>
  
  <p>but i don't want those if conditions because i have number of factories. Is there any way to call a method inside that factory like in java script 
  <br/>
  <code>window[var]</code></p>