CrazzyMarc CrazzyMarc - 6 months ago 29
AngularJS Question

AngularJS, how to use JSON from child in parent?

When an item is selected in the select box, I want to use the other field in the parent div. In this case the country.

My code:


<div class="field" id="{{$index+1}}" ng-repeat="t in getTimes(fieldSelect) track by $index")>
<select name="drop_down" class="marketSelect">
<option ng-repeat="item in items">{{}}</option>


method: 'GET',
url: 'assets/json/currency.json'
}).then(function successCallback(response) {
$scope.items =;
}, function errorCallback(response) {
console.log("Oh shit, JSON is not working");


Use the ng-model directive in combination with the ng-options:

<select ng-options="item as for item in items" 

Then in your div:

{{ }}

See this jsfiddle