Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48978

[Ionic 5] Tabs are Autofreshing with Data update

$
0
0

I have the code below … you’ll see two boolean values that show an ion-badge if true. Problem is … if the values are updated the tabs are reset to screen 0.

Both Variables are set from a subscribe to a service variable. It is updated based on data changing in the database. How do I prevent the Tabs from resetting when the data is changed?

`<ion-tabs *ngIf=“userStatus !=‘suspend’”>



<ion-tab-button tab="matches" title="Matches">
  
     <ion-icon   name="heart-outline" style="pointer-events: none;"></ion-icon>
     <ion-badge color="danger" *ngIf="hasNewMatches"></ion-badge>
     
 
</ion-tab-button>

<ion-tab-button tab="chat-list" title="Messages">
  <ion-icon name="chatbubble-outline"  style="pointer-events: none;"></ion-icon>
  <ion-badge color="danger" *ngIf="newMessageCount">{{ newMessageCount }}</ion-badge>
  
</ion-tab-button>
<ion-tab-button tab="settings" title="Settings">
  <ion-icon name="settings-outline"  style="pointer-events: none;"></ion-icon>
</ion-tab-button>
`

6 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 48978

Trending Articles