This is my JSON object:
{
Stores: [
{
Name: "Store #1",
DealerType: "Office"
},
{
Name: "Store #2",
DealerType: "Office"
},
{
Name: "Store #3",
DealerType: "Office"
},
{
Name: "Store #4",
DealerType: "Headquater"
},
]
}
This is my view:
<select id="dealerType">
<option value="">All</option>
<option value="Office">Office</option>
<option value="Headquater">Headquaters</option>
</select>
<ul>
<li ng-repeat="store in stores | filter:dealerType">{{store.Name}}</li>
</ul>
I want to only show the one store with DealerType: "Headquater"
on pageload and still be able to use the filter functionality from the <select>
-element
I have tried to change the ng-repeat
to: ng-repeat="store in stores | filter:{DealerType: 'Headquater'} | filter:dealerType"
.
This does filter by the DealerType, but will not be changed when I update the "dealerType" select.