I am trying to have one static button in segment and remaining are dynamic my dynamic part is working but my static segment button is not showing all the product
here is my .html file
<ion-content >
<ion-segment [(ngModel)]="kmart" color="primary">
<ion-segment-button value="All">
All
</ion-segment-button>
<ion-segment-button *ngFor="let tabName of buttonName" value={{tabName.product_type}}>
{{tabName.product_type}}
</ion-segment-button>
</ion-segment>
<div [ngSwitch]="kmart" *ngFor = "let demo of demoObj">
<ion-list *ngSwitchCase="All">
<ion-item>
{{demo.name}}
</ion-item>
</ion-list>
<ion-list *ngSwitchCase="demo.product_type">
<ion-item>
{{demo.name}}
</ion-item>
</ion-list>
</div>
</ion-content>
here is my .ts file
demoObj = [ {"product_id": "52","name": "Apple - Fuji","product_type": "Fruits"},
{"product_id": "53","name": "bana - Fuji","product_type": "Fruits"},
{"product_id": "54","name": "beetroot - Fuji","product_type": "Vegitables"},
{"product_id": "55","name": "beens - Fuji","product_type": "Vegitables"},
{"product_id": "56","name": "mango - Fuji","product_type": "Fruits"}
];
buttonName = [{"product_type": "Fruits"},{"product_type": "Vegitables"}];
Question:
here at first time am able to display all the products but after switching to another segments and then i am come to 'All' segment I am not able to display any one can find any mistake.