title: Pass data (retrieved from server) from parent route to its child route
body: <p>My Angular application have parent and child route. I am using (ui-router)
  I what to build that parent route data (which are retrieved from server using $resource) are passed to its child route. </p>
  
  <p>Here will be my application code. When I debugged my code, then "phaseTasks" in child route always was empty Array.</p>
  
  <pre><code>flowAdminApp.config(['$stateProvider', '$urlRouterProvider',
    function($stateProvider, $urlRouterProvider){
  
      $stateProvider
        .state('phase', {
          url: "/phases/:phase_id",
          template: JST['layouts/admin/flows/tasks/index'],
          resolve: {
            phaseTasks: ['$stateParams', 'taskData',
              function( $stateParams, taskData ){
                return taskData.getPhaseTasks($stateParams.phase_id);
            }]
          },
          controller: 'taskListController'
        })
        .state('phase.task', {
          url: "/tasks/:task_id",
          template: JST['layouts/admin/flows/tasks/show'],
          resolve: {
            task: ['$stateParams', 'phaseTasks',
              function( $stateParams, phaseTasks ){
  
                // phaseTasks is empty Array
  
            }]
          },
          controller: 'taskController'
        })
  }]);
  
  flowAdminApp.factory('taskData', [ '$resource',
    function ($resource) {
      return {
        getPhaseTasks: function (phase_id) {
          return $resource('/admin/tasks.json?phase_id=:phase_id', {phase_id:'@phase_id'}).query({phase_id:phase_id});
        }
      }
  }]);
  </code></pre>
  
  <h3>When I changed my code that parent data are static, then "phaseTasks" passed to child route correctly.</h3>
  
  <pre><code>flowAdminApp.config(['$stateProvider', '$urlRouterProvider',
    function($stateProvider, $urlRouterProvider){
  
  $stateProvider
    .state('phase', {
      url: "/phases/:phase_id",
      template: JST['layouts/admin/flows/tasks/index'],
      resolve: {
        phaseTasks: ['$stateParams',
          function( $stateParams ){
            return [{a: 1}]
        }]
      },
      controller: 'taskListController'
    })
    .state('phase.task', {
      url: "/tasks/:task_id",
      template: JST['layouts/admin/flows/tasks/show'],
      resolve: {
        task: ['$stateParams', 'phaseTasks',
          function( $stateParams, phaseTasks ){
  
            // phaseTasks is [{a: 1}] 
  
  
        }]
      },
      controller: 'taskController'
    })
  }]);
  </code></pre>
  
  <p>How to pass data (retrieved from server) from parent route to its child route or prevent child route loading until parent route data are retrieved from database ?</p>