Can anyone help me figure out how to disable an option in one select list when it is selected in another using AngularJS? I have set up a select list for From Year and To Year with ng-repeat, which is working fine. Now, I just need to implement the functionality where selecting an option in one list disables that option in the other list. Any ideas on how to achieve this?
Thank you in advance!
Here is the HTML code:
<li>
<select class="form-control">
<option value="" selected disabled>From Year</option>
<option ng-repeat="option in selectedYear" >{{option.years}}</option>
</select>
</li>
<li>
<select class="form-control">
<option value="" selected disabled>To Year</option>
<option ng-repeat="option in selectedYear" >{{option.years}}</option>
</select>
</li>
And here is the JSON data:
{"json1":"[{\"years\":2018},{\"years\":2017},{\"years\":2016},{\"years\":2015}]