I was trying to achieve cascading drop downs based on country , state , city found from the below links that i had attached and i was confusing with the regular expression for ng-options using array's and ng-option's with key value pair.
i have tried few examples that was from online to understand how ng-options work with below examples
https://gist.github.com/marlonbbernal/08451bdbcff5986bcb9a
http://embed.plnkr.co/vxgO1a/
i am confused with the below expression usages of ng-options :
link1 for ng-options :
<select id="country" ng-model="statessource"
ng-options="country for (country, states) in countries"
ng-change="GetSelectedCountry()">
<option value=''>Select</option>
</select>
$scope.GetSelectedCountry = function () {
$scope.strCountry = document.getElementById("country").value;
};
how to achieve the state directly in options ?..
Can any one please , explain how ng-option expression works. i will be
monitoring this thread, actively !..
The keys are 'India', 'USA' and 'Australia', For (key, value) pair you have a value for each key. For example, If you use