Nested resolves in UI Router not resolving
<p>I'm attempting to pass the results of UI-Router resolve to another resolve method in UI-Router but I find that any time I do this the following (nested) method fails to resolve.</p>

<p>The code below should resolve information about a user (called <code>SellerData</code> here), pass relevant parameters to an access check (called <code>SubscriptionId</code>) and the get some information using those two values (<code>sanitizedProduct</code>) All of this code independently works if I hardcode the results into the methods (ie replace <code>SellerData.product.id</code> with a value in <code>getSubscriptionId</code>) but as soon as I pass a resolved object the code fails and the resulting page never loads. </p>

<p>It's entirely possible I'm wrong about the nested nature of this stuff being an issue but I'm afraid I'm not seeing a ton of information about this issue so this is my best guess after spending quite a bit of time isolating stuff.</p>

<p><strong>UPDATE 3.19</strong></p>

<p>Based on <a href="https://stackoverflow.com/a/36126979/1888712">this answer</a> from Estus it's clear I'm making a mistake with promises (I had stupidly assumed resolve calls were synchronous) but the code is still not resolving properly. With this version both <code>SellerData</code> and <code>SubscriptionId</code> resolve properly and in the correct sequence but the <code>getSanitizedProduct</code> method is not called</p>

<pre><code>.state('subscriberArea', {
    url: '/:creatorUsername/subscriber',
    templateUrl: 'modules/subscriber/client/views/subscriberArea.client.view.html',
    controller: 'SubscriberAreaController',
    controllerAs: 'vm',                 
    resolve: {
        SellerData: getSellerData,
        SubscriptionId: getSubscriptionId,
        sanitizedProduct: getSanitizedProduct,
    },
    data: {
        pageTitle: 'Subscriber'
    }
})
</code></pre>

<p>Gets information about seller to be used in following methods and page binding</p>

<pre><code>getSellerData.$inject = ['$stateParams', 'UserData', '$q', '_'];
function getSellerData($stateParams, UserData, $q, _){
    // Creates query to be passed to 'UserData' service that queries mongo
    var deferred = $q.defer();
    var query = {'username': $stateParams.creatorUsername};
    return UserData.findOne(query).then(function(seller){
        // Adds essential information from query to new object that will be returned to the resovle
        var sellerData = {};
        sellerData._id = seller._id;
        sellerData.product.id = seller.product.id;  
        deferred.resolve(sellerData);
        return deferred.promise;
    });
}       
</code></pre>

<p>Find if a value on the user object (known as Authentication) matches the product id resolved from getSellerData and set that value as the 'SubscriptionId' resolve </p>

<pre><code>getSubscriptionId.$inject = ['Authentication', '_', '$q', 'SellerData'];
function getSubscriptionId(Authentication, _, $q, SellerData){
    var promises = [SellerData];
    $q.all(promises).then(function(resolved){
        var sellerData = resolved[0];
        var subscriptionId = _.intersection(Authentication.user.purchases, sellerData.product.id);
        deferred.resolve(subscriptionId);
        return deferred.promise;
    })
}
</code></pre>

<p>Query a database with the resolved SellerData and SubscriptionId information</p>

<pre><code>getSanitizedProduct.$inject = ['ProductData', 'SellerData', 'SubscriptionId', '$q'];
function getSanitizedProduct(ProductData, SellerData, SubscriptionId, $q){
    var promises = [SellerData, SubscriptionId];
    $q.all(promises).then(function(resolved){
        var sellerData = resolved[0]
        var subscriptionId = resolved[1]
        var productId = sellerData.product.id;
        var versionId = {'version': subscriptionId};
        return ProductData.getWhitelistedData(productId, versionId).then(function(product){
            // plain() is a Restangular method that strips unnecessary properties
            return product.plain();
        });
    }
}
</code></pre>

<p><strong>ORIGINAL</strong></p>

<p>Basic UI-Router setup:</p>

<pre><code>.state('subscriberArea', {
    url: '/:creatorUsername/subscriber',
    templateUrl: 'modules/subscriber/client/views/subscriberArea.client.view.html',
    controller: 'SubscriberAreaController',
    controllerAs: 'vm',                 
    resolve: {
        SellerData: getSellerData,
        SubscriptionId: getSubscriptionId,
        sanitizedProduct: getSanitizedProduct,
    },
    data: {
        pageTitle: 'Subscriber'
    }
})
</code></pre>

<p>Gets information about seller to be used in following methods and page binding</p>

<pre><code>getSellerData.$inject = ['$stateParams', 'UserData', '_'];
function getSellerData($stateParams, UserData, _){
    // Creates query to be passed to 'UserData' service that queries mongo
    var query = {'username': $stateParams.creatorUsername};
    return UserData.findOne(query).then(function(seller){
        // Adds essential information from query to new object that will be returned to the resovle
        var sellerData = {};
        sellerData._id = seller._id;
        sellerData.product.id = seller.product.id;
        return sellerData;
    });
}       
</code></pre>

<p>Find if a value on the user object (known as Authentication) matches the product id resolved from getSellerData and set that value as the 'SubscriptionId' resolve </p>

<pre><code>getSubscriptionId.$inject = ['Authentication', '_', 'SellerData'];
function getSubscriptionId(Authentication, _, SellerData){
    return _.intersection(Authentication.user.purchases, SellerData.product.id);
}
</code></pre>

<p>Query a database with the resolved SellerData and SubscriptionId information
    getProduct.$inject = ['ProductData', 'SellerData', 'SubscriptionId'];</p>

<pre><code>function getSanitizedProduct(ProductData, SellerData, SubscriptionId){
    var productId = SellerData.product.id;
    var versionId = {'version': SubscriptionId};
    return ProductData.getWhitelistedData(productId, versionId).then(function(product){
        // plain() is a Restangular method that strips unnecessary properties
        return product.plain();
    });
}
</code></pre>