You need to use filter in correct order.
For category
dropdown
- add a filter by
brand
likefilter:{brand: filterObject.brand}: true//pass true for strict mode
- then the
unique
filter likeunique: 'category'
- and last the
orderBy
filter likeorderBy:'category'
In HTML
, it looks like
<select ng-model="filterObject.category"
ng-options="c.category as c.category for c in shoes|filter:{brand: filterObject.brand}: true| unique: 'category'| orderBy:'category'">
<option value="" ng-value="undefined">-- Category:</option>
Similar for Brand
dropdown
<select ng-model="filterObject.brand"
ng-options="b.brand as b.brand for b in shoes|filter:{category: filterObject.category}: true| unique: 'brand'| orderBy:'brand'">
<option value="" ng-value="undefined">-- Brand:</option>
Look both dropdowns
are bind with your main data source $scope.shoes
so you don't need the additional filter in your controller.
check the updated plunk
Note As @m59 mentioned you shouldn't delete your post when you are looking for an answer.