ion-segment doesn't refresh for hiding div <div *ngIf="isActive"> #1536
Description
Short description of the problem:
In .html I have a segment
<ion-segment small [(ngModel)]="isActive" (ionChange)="loadActive($event)">
<ion-segment-button small value=true>
<ion-label>Active</ion-label>
</ion-segment-button>
<ion-segment-button small value=false>
<ion-label>Inactive</ion-label>
</ion-segment-button>
</ion-segment>
and simple code to show or hide just to test.
{{isActive}}
<div *ngIf='!isActive'>
hello not active
</div>
<div *ngIf='isActive'>
hello yes
</div>
result is:
for tab active:
true
hello yes
for tab inactive:
false
hello yes
What behavior are you expecting?
for tab inactive should be :
false
hello not active
ionic info
Ionic:
Ionic CLI : 5.2.6 (/Users/mirg/.nvm/versions/node/v10.14.2/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.6.2
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : browser 5.0.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 12 other plugins)
Utility:
cordova-res : not installed
native-run : 0.2.2 (update available: 0.2.8)
System:
NodeJS : v10.14.2 (/Users/mirg/.nvm/versions/node/v10.14.2/bin/node)
npm : 6.10.2
OS : macOS Mojave
Xcode : Xcode 10.3 Build version 10G8