assuming the other ng-model is search.weapon
wouldnt this work?:
<li ng-repeat="item in items | filter: search.attribute | filter:
search:weapon">{{item.name}}</li>
Did you try it?
On Saturday, January 18, 2014 12:19:31 PM UTC+2, Shunsuke Hakamata wrote:
>
> Hello,
>
> I want to filter list by this object.
>
> $scope.items = [
> {name: 'fire-gun', attribute: 'fire', armor: 'gun', ratiry: 0},
> {name: 'wind-gun', attribute: 'wind', armor: 'gun', rarity:1},
> {name: 'fire-sword', attribute: 'fire', armor: 'sword', rarity:0},
> {name: 'water-sword', attribute: 'water', armor: 'sword', rarity:2},
> ];
>
> To filter this items list, I prepared this HTML.
> I want to filtering by two select element and three data type.
>
> <select ng-model="search.attribute">
> <option value="fire">Fire</option>
> <option value="wind">Wind</option>
> <option value="water">Water</option>
> </select>
>
> <select ng-model="???">
> <optgroup label="armor">
> <option value="gun">Gun</option>
> <option value="sword">Sword</option>
> </optgroup>
> <optgroup label="rarity">
> <option value="0">normal</option>
> <option value="1">hyper</option>
> <option value="2">special</option>
> </optgroup>
> </select>
>
> <ul>
> <li ng-repeat="item in items | filter: search">{{item.name}}</li>
> </ul>
>
>
> I have problem to make a appropriate search object from two select element.
>
> Do you have a nice idea for this?
>
> cheers,
>
> Shunsuke Hakamata
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.