Choosing a category:
<ion-select name="categories">
<ion-option *ngFor="let category of categories;">
{{category}}
</ion-option>
</ion-select>
Listing the items:
<ion-item-sliding *ngFor="let item of items; let idx = index;">
<ion-item>
<h2>{{item.title}}</h2>
</ion-item>
...
</ion-item-sliding>
How can I use the value from (select) to choose which category gets listed? I tried adding a ngModule in and passing it as a condition into the sliding ngFor, but it wouldn't work.
You can use a pipe to achieve this
In your transform method you can perform your logic
Sample Plunker
Update 1 : Complete answer
Custom pipe will have the below code,
Dropdown and list of items
LIVE DEMO
You can also simply put
and display
itemsForDisplay
in your template instead ofitems
you can use ngx-pipes library for doing incredible filtering and transforming in arrays and strings.
for your Question you can use filterBy pipe in
ngx-pipes
library.