Angularjs two stage resolve (resolve dependencies)
<p>I have a state where I need to resolve one item before I have the data to resolve the other:</p>

<pre class="lang-js prettyprint-override"><code>      .state('addtrip', {
        url: '/addtrip',
        templateUrl: 'views/addtrip.html',
        controller: 'AddtripCtrl',
        resolve: {
          auth : function($state, Auth){
            return Auth.$requireAuth().then(function(auth) {
              return Auth;
            }, function(error){
              $state.go('login');
            });
          },
          trips : function(rootRef,$firebaseArray){
            return $firebaseArray(rootRef).child(auth.uid).$loaded();
          }
        }
</code></pre>

<p>So first I want to get the auth object and only after I want to retrieve the trips of that specific user. </p>

<p>What's the best way to handle situations like this?</p>