Nav.setRoot is not working when i'm trying to go outside a tab

I’ve a function located in my program. If i obtain certain value i redirect the user to a page outside of the tabs.

In a function this works, in another function not. I don’t understand nothing

Provide your .TS file here so we can watch the code

It’s quite long… I’ve a function who check if a variable is setted to true, if not i redirect to the user

Cant help you further with the information you are providing at this moment.
Doesn’t matter, just share it and we can help you.

Paste it in code tag.


I have a function inside of a tab who do this

    this.navCtrl.setRoot(OfflinePage, {texto: 'No connection!'});

I don’t know why but if i do that the Page is pushed inside the tab and not setted as a root… I don’t know why, it’s annoying and i’ve spent all the morning with this

Yeah, I really can’t help you with the information you provide.
I asked for your .TS file, it’s for me just taking a gamble at this moment with throwing possible solutions.

My question is: How can i setRoot another page programatically if i’m in a ts who contains a TAB.
I wanna go to another page, not load or push a page into that tab

Normally is that possible with the code you provided above.
But I cant help you further then this.

I’m trying to do this inside a page in a view of a tab. My intention is navigate to a page and set root inside a page, i’m trying this but doesn’t works

@ViewChild(Nav) nav: Nav;
pages: OfflinePage;

ERROR TypeError: Cannot read property 'setRoot' of undefined