-2

I have a simple ngSwitchCase scenario

I want to watch for and get notified of ngSwitchCase in the controller, Basically when i switch between tabs.

Any ideas?

Patrioticcow
  • 26,422
  • 75
  • 217
  • 337

1 Answers1

0

Looking at the docs I see there is an output event called ionChange. You could hook into that:

<ion-segment [(ngModel)]="selectedTab" (ionChange)="selectedTabChanged($event)">
    ...
<ion-segment>

And in your component you then have your method:

selectedTabChanged($event): void {
    // do something here
}
Maximilian Riegler
  • 22,720
  • 4
  • 62
  • 71