I have Tabs built with start tabs project and inside one tab class home.ts I have:
export class HomePage implements OnInit, OnChanges, AfterViewInit, OnDestroy {
// Show/Hide test
test: number; /// now it is undefined
(...)
constructor(public navCtrl: NavController) {
(...)
this.test = 0;
// Subscribe to some of the delegate's event handlers
this.delegate.SomeAsynchronous()
.subscribe(
data => {
console.log('=== OK ===='+ this.test);
// the most important
this.test = 1;
console.log('=== OK ===='+ this.test);
},
(.... error.... )
);
}
I have template home.html of this page where content is like this:
{{test}}
<ion-card *ngIf="test > 0">
(...)
</ion-card>
And the test value changes asynchronusly I see this in the log but ion-card is not visible. BUT when I go to other tab and back to home it is visible but if asynchronusly back to 0 (from 1) nothing happen even I change the tab.
How to do that right? I mean how to change visibility of something in the tab after asynchronic changes?