I want to populate a dropdown list with a few custom values using Angular.js ngOptions
Eg:-
<option value="' + info[x].CountryCode
+ '" data-image="images/msdropdown/icons/blank.gif"
data-imagecss="flag ' + info[x].CountryCode
+ '" data-title="'
+ info[x].CurrencyName + '" >'
+ info[x].CurrencyCode + '
</option>
Following is the data in JSON format :
[{
"Id": 3,
"CountryName": "Australia",
"CountryCode": "au",
"CurrencyCode": "AUD",
"CurrencyName": "Australian Dollar",
"CurrencyValue": 0.018,
"PayPalCountryCode": 12,
"PayPalCurrencyCode": 78,
"IsActive": true
},
{
"Id": 19,
"CountryName": "Taiwan",
"CountryCode": "tw",
"CurrencyCode": "TWD",
"CurrencyName": "New Taiwan Dollar",
"CurrencyValue": 0.48,
"PayPalCountryCode": 208,
"PayPalCurrencyCode": 148,
"IsActive": true
},
{
"Id": 2,
"CountryName": "United States",
"CountryCode": "us",
"CurrencyCode": "USD",
"CurrencyName": "US Dollar",
"CurrencyValue": 0.016,
"PayPalCountryCode": 225,
"PayPalCurrencyCode": 125,
"IsActive": true
}]
I am new to Angular, could someone show me how to do this using ngOptions ?