I have a select with ng-options + filter and need to apply a condition to the filter itself. So if a specific condition is met then apply the filter otherwise don't. Thanks in advance.
# example
if (elb_vm.elbInstances[index]['new_record?']){
apply ng-options filter.
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<section ng-app="myApp">
<div ng-controller="AppCtrl">
<select ng-model="selected"
ng-options="('Subnet: ' + type) for type in types | filter: '!public' : true">
</select>
</div>
</section>
elb_vm.elbInstances[index]['new_record?']
is true then show only["publicExtra", "private"]
else show all options["publicExtra","public","private"]
? – palaѕн