The following code works, and I get the JSON below returned. What I'm interested in is the cars_url. How can I get the URL (and what is the best way) then make a secondary get request?
JSON
{
created: "2013-11-08T18:57:44",
domain: "www.test.com",
cars_url: "/api/v1/carlot/4",
image: null,
modified: "2013-11-08T18:57:44"
}
JavaScript
app.factory('CbgenRestangular', function(Restangular) {
return Restangular.withConfig(function(RestangularConfigurer) {
RestangularConfigurer.setBaseUrl('http://127.0.0.1:8000');
});
});
app.controller("CampaignData" ,
[
'$scope',
'Restangular',
'CbgenRestangular',
function($scope, Restangular, CbgenRestangular){
CbgenRestangular.one('api/v1/person', "james").get().then(
function(person) {
$scope.person = person;
console.log(person)
}
);
}
]);