Project details: Using Ionic Cordova Version of Ionic: 7 Angular version: 18.0.3
The *ngIf directive is not functioning as expected.
page.html
<ion-segment [(ngModel)]="segment" (ionChange)="typeChange($event)">
<ion-segment-button value="right">
<ion-label>Right</ion-label>
</ion-segment-button>
<ion-segment-button value="missing">
<ion-label>Missing</ion-label>
</ion-segment-button>
<ion-segment-button value="damaged">
<ion-label>Damaged</ion-label>
</ion-segment-button>
</ion-segment>
<div *ngIf="segment == 'right'">
Right
</div>
<div *ngIf="segment == 'missing'">
Missing
</div>
<div *ngIf="segment == 'damaged'">
Damaged
</div>
page.ts:
segment = "right";
typeChange(event) {
console.log(this.segment);
}
Above represents my code snippet.
Actual output image link Seeking assistance in resolving the issue.
Thank you for your help!