How to get the last shown page?

Hi there,

somehow I need to get the name of the last shown page.

There are three pages: Page one, two and three.

Starting at the first page, I click around over the second straight ahead to the third page. When I go back from the third page to the second page, either by clicking on back in html, calling navCtrl.back() or pushing the smartphones back button, I need to know at the showing state of the second page, if the last page was the first or third page. It’s that simple.

I cannot use the way over GET-parameters in the calling route path for the second page, when pushing any back buttons. A way over a singleton/service is imaginable, but isn’t there an eleganter way?

Best regards
Sue

Sorry, I allmost forgot …


Ionic:

   ionic (Ionic CLI)             : 4.12.0 (C:\Users\xxx\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.1.1
   @angular-devkit/build-angular : 0.13.6
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.6
   @ionic/angular-toolkit        : 1.4.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 5 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\xxx\AppData\Local\Android\Sdk)
   NodeJS            : v8.12.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.4.1
   OS                : Windows 7