title: How to use CachedResourceLoader as an equivalent mechanism to $templateCache in Angular2?
body: <p>I know there are <a href="https://stackoverflow.com/questions/34421869/templatecache-in-angular-2">2</a> <a href="https://stackoverflow.com/questions/34418914/alternatives-to-templatecache-in-angular2">similar</a> questions about this but with no solution for any of them. </p>
  
  <p>So I found <a href="https://github.com/angular/angular/issues/6612" rel="nofollow noreferrer">this</a> issue in Angular repo where they ask for the same, i.e an alternative for templateCache in Angular 2 but they close it saying you can use CachedResourceLoader.</p>
  
  <p>So my question is <strong>how to use this CachedResourceLoader to replace the templateCache</strong>, I have been searching on google about this but couldn't find any related content so maybe I am not pointing to the right direction or I missed something.</p>
  
  <p>The answer to this question could be a valid answer for the other 2 similar questions.</p>
  
  <p>Code example for the functionality that templateCache provided in AngularJS:</p>
  
  <p><strong>Adding</strong>:</p>
  
  <pre><code>var myApp = angular.module('myApp', []);
  myApp.run(function($templateCache) {
    $templateCache.put('templateId.html', 'This is the content of the template');
  });
  </code></pre>
  
  <p><strong>Retrieval</strong> via $templateCache:</p>
  
  <pre><code>$templateCache.get('templateId.html')
  </code></pre>
  
  <p>Or retrieval:</p>
  
  <pre><code>myApp.component('myComponent', {
     templateUrl: 'templateId.html'
  });
  </code></pre>