title: Using $templateCache with ui-router and uglify in angular 1.x
body: <p>Sharing this as a Qusstion-answer post.</p>
  
  <p>What to do when you have to use <code>$templateCache</code> in <code>templateProvider</code> of a route in ui-router and have to utility the code? Injecting does not work, and angular cannot inject by reference.</p>
  
  <p>Example :</p>
  
  <pre class="lang-js prettyprint-override"><code>...  
  templateProvider : function($templatecache) {
  
      ...
  
  },
  
  ...
  </code></pre>