I'm trying to use a directive twice and filter using the options created by the directives. For some reason the chemicalsFilter
isn't working as expected. If I use either of the filters on the ng-repeat
it works but using both together isn't working. I'm wondering if this could be a scope issue within the directives but each seem to return the correct data. It outputs in the console as I expect but the filtering just doesn't work as expected.
Any ideas? If I can get this sorted it will be so much easier creating multiple combo boxes in my project.
This is my example plnkr: http://plnkr.co/edit/FTPdSSiKSOZiWptfJzuC?p=preview
Original example (both examples do the same thing): http://democode.6te.net/filterusingdirectives/
<div ng-controller="resultsCtrl">
<div ng-controller="chemicals">
<combo-box url="/filterusingdirectives/php/getChemicals.php" list-name="Select Chemicals" loading-message="loading chemicals ..." combo-box-directive-selected-values="getSelectedChemicalValues"></combo-box>
</div>
<div ng-controller="letters">
<combo-box url="/filterusingdirectives/php/getLetters.php" list-name="Select Letters" loading-message="loading letters ..." combo-box-directive-selected-values="getSelectedLetterValues"></combo-box>
</div>
<div ng-repeat="result in results | chemicalsFilter:selectedChemicalValues | lettersFilter:selectedLetterValues">
letterId: {{result.letterId}}
<br />
chemicalId: {{result.chemId}}
<br />
name: {{result.name}}
<br /><br />
</div>
</div>