<div ng-repeat="item in actionLabels">
<!-- Setting select field model dynamically using loop index -->
<select ng-model="formValues.selectedActionLabelOptions[$index]"
ng-options="obj.optionId as obj.optionDescription for obj in actionLabelOptions>
ng-change="showRespectiveInput()"
<option value="Select">Select</option>
</div>
I want to add a condition to ng-options. condition is :
If($index == 0 && optionId == 5) then I don't want to add this option to select field. i.e for the first time when loop executes the 5th option in the select field ll not appear.
I am not sure where to put this condition.
I tried with following piece of code by creating ng-option through ng-repeat:
<option ng-repeat="option in actionLabelOptions" ng-hide="$parent.$index == 0 && option.optionId == 5">
This works fine to generate options for respective rows. i.e for the first row 5th option never comes. But ng-change event is not fired.
Can anyone help me regarding this?