After successfully running the code snippet, I received the JSON output displayed below. My main focus now is on extracting the cars_url
. What would be the most effective method to retrieve the URL (and what approach is recommended), and subsequently initiate a secondary GET request?
JSON Output
{
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 Function
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)
}
);
}
]);