Hi,

I have a filter for some listing data and one of these is listingType. 

Options would end up being 
<option value="1">Type 1</option>
<option value="2">Type 2</option>
<option value="3">Type 3</option>
<option value="4">Type 4</option>

I am using ng-options to build out the options and want to have ‘select 
all’ so that if the user filters the listings by option type but then 
wishes to view all again they can do. At the moment when I load the view 
all listings are showing but then if I select a listing type and then go 
back to 'View all' I see no listings.

When I add this as <option value=””>View All</option> it doesn’t have the 
desired effect i.e showing all the listings again. 

Can anyone point me in the right direction?

My code


        <label class="sf-label">Listing Types</label>
        <select
            class="form-control"
            ng-model="vm.search.listingType"
            ng-options="listingType.ID as listingType.name for listingType 
in vm.listingTypes">
            <option value>
                All Listing Types
            </option>
        </select>


<div ng-repeat="listing in vm.listings | filter: vm.search | orderBy: 
vm.orderBy.sortField : vm.orderBy.doReverse" ng-if="vm.listings.length">
.... my listing stuff....
</div>

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" 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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to