I am trying to use a filter that I have written in my controller to narrow down a select list using ng-options. The filter logic is working, but the results aren't getting displayed.
Here's the relevant part of my controller:
$scope.ESGFilter = function() {
var esg;
var filteredESGs = [];
// LOGIC GOES HERE TO POPULATE THE filteredESGs ARRAY
console.log(filteredESGs);
return filteredESGs;
}]);
Here's the HTML:
<select class="input-block-level" id="inputESG" name="inputStoch"
ng-model="Run.ESG"
ng-options="econ.Id as econ.Name for econ in econData | filter:ESGFilter" size="5">
</select>
I suspect the issue has to be with "filter:ESGFilter" in the HTML... I can't figure out why the array that I return from the function isn't being displayed. The function in the controller is definitely being called and the logic is working.
For reference, the console.log outputs: [Object, Object] -- when I expand the properties of these objects, I confirm that they are the ones that I want. The select list, however, displays all four objects (I'm filtering down from an array of four).