I have a select that has a filter set to not show the 'public' string in an array (public, publicExtra and private) if a specific condition is met in the ng-if. But now I discovered that that is not the only condition required and it seems like I have to duplicate the select with different conditions in order to achieve what I want, this becomes very messy. Is there a way to create a filter in the controller and set the conditions there and then show the filter in the activate the filter on the select if all the conditions are met? Thanks in advance.
<select ng-model="elb_instance.use_vpc"
ng-if="elb_instance['new_record?']"
ng-options="('Subnet: ' + type) for type in elb_instance.vpc_names_with_subnet_types_for_elb[elb_instance.vpc_name] | filter: '!public' : true"
ng-show="elb_instance.vpc_name"
id="use_vpc"
class="input-medium">
<option value="">Select subnet</option>
</select>```
Yes, you can use a custom filter with arg:
| myfilter:conditionswhere
myfiltercan be something like:where
itemsareelb_instance.vpc_names_with_subnet_types_for_elb[elb_instance.vpc_name]