ng-options が入力されたドロップダウン メニューがあります。
<label class="item item-input item-select">
</div>
<div class="input-currencies">
Select Currency
<select ng-options="c.code as c.name for c in currencies" ng-model="codeMod" ng-change="currencyChange(codeMod)">
</select>
</label>
値 c.code を selectedCurrency という名前の変数のプロパティにするにはどうすればよいですか?
.controller('CurrencyController', function($scope, $http) {
var ngb_currencies = 'http://lari.jumpstart.ge/en/api/v1/nbg_currencies?callback=JSON_CALLBACK'
var selectedCurreny = "" // I want get dropdown code in this variable depending on the selected currency so I make changes in the API
$http.jsonp(ngb_currencies).success(function(currency) {
$scope.currencies = currency.results;
})
.error(function(data) {
alert("ERROR");
});
$http({
method: 'jsonp',
url: 'http://lari.jumpstart.ge/en/api/v1/nbg_rates?callback=JSON_CALLBACK',
params: { currency: selectedCurreny }
}).success(function(data, status , header, config) {
console.log('success');
$scope.result = data.result;
console.log('success');
}).error(function(data, status , header, config) {
console.log('error');
});