title: Using $templateCache in ui-router's template
body: <p>Can i use $templateCache in ui-router's template?</p>
  
  <p>The template will be cached in resolve section and i want to use cached template in the same state.</p>
  
  <pre><code>$stateProvider
  .state('dashboard', {
      url: "/dashboard",
      template: function($templateCache){  
          console.log('test 2');
          return $templateCache.get('templates/template1.html'); // returns undefined
      },
      resolve:{
          baseTemplates: function($ocLazyLoad) {
              // here the template will be cached...
              return $ocLazyLoad.loadTemplateFile(['base/dashboard.html']).then(function(){
                  console.log('test 1');
              });
          }
      }
  })
  // console prints "test 2" before than "test 1"
  </code></pre>
  
  <p><strong>Update: (+ Code updated)</strong></p>
  
  <p>I Think resolve section of my code has an issue. because it runs after template section! and it cause returning $templateCache.get being undefined.</p>
  
  <p>I use ocLazyLoad plugin to cache template and it returns a correct promise.</p>
  
  <p><strong>Why template don't waits for resolve?</strong></p>