So I've got a resource set up like so.
.factory('ChannelListing', function($resource) {
return $resource('/api/v1/channel_listings.json?channel_id=:channel_id',
{channel_id: '@channel_id'},
{'query': {method:'GET', isArray:false}});
})
Along with a conroller set up like so...
.controller('ChannelListingCtrl', function($scope, ChannelListing) {
ChannelListing.query(function(data){
$scope.channellistings = data.results;
});
})
The issue is that I want the @channel_id to come via a user object that I'm pulling in from another resource set up like so...
.factory('userFactory', function($resource) {
return $resource('/users/me.json');
})
This $resource returns all the user data from the current logged in users and contains the channel_id field. How can I get this field ID and pass it to the other resource?