Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70440

app.getActiveNav().getActive() is undefined

$
0
0

@pdj wrote:

when it comes to last page(HomePage), I want to exit app.

but the problem is that weirdly,
app.getActiveNav().getActive() is undefined.
and

I took a look closer on app.getActiveNav()
(I checked Log and saw undefined on root)

my code is located in app.components.ts

   platform.registerBackButtonAction(() => {
        let nav = this.app.getActiveNav().getActive()
        let activeView = nav.getActive();
      
      console.log("back pressed");
      console.log(nav)
      console.log(activeView)
           nav.pop();
          });

weirdly , I came to second page from homepage,
when I press back button on hardware,
it says no views in the stack to be removed
(I came to second page by using navCtrl.push())

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>