http GET リクエストを作成し、そのレスポンスの一部を使用して別の http GET リクエストを作成する関数を作成しています。ただし、最初の http GET 要求によって返されるデータは、多くの不要なデータ (promise オブジェクトである可能性があります) でラップされていますが、その json コンポーネントが必要なだけです。コントローラーで応答の json データにアクセスするにはどうすればよいですか? これが私のコードです。
$scope.doSearch = function() {
var upcResult = Restangular.one('upc',$scope.searchTerm).get()
//the upc returns an item, so i am trying to access that part of the json by using
upcResult.item, how if I console.log that it is undefined
$scope.doAnotherSearch = function() {
var itemResult = Restangular.one('item',upcResult.item).get();
}