i want to filter my output based on the selected value in a component:
<select ng-model="showGroup.group">
<option value="A">A</option>
<option value="B">B</option>
</select>
My Data which i want to show:
{
"name" : "Steve",
"group" : "A"
},
{
"name" : "Bob",
"group" : "B"
},
{
"name" : "Peter",
"group" : "B"
},
If a "A" is selected then i should show only Steve and if "B" is selected it should show Bob and Peter!
My Outputcode:
<table>
<tr ng-repeat="person in persons">
<td>{{person.name | filter:showGroup}}</td>
</tr>
</table>
The Controller only gets the data from a JSON file.
Why this is not working?
With an <input> element it works fine?!
Do I need to write my own filter? How do i do that?