How to use getRootNavById?

can anyone help me with examples of how to use getRootNavById?

What are you trying to achieve?

I have 3 pages

currently to send: (). setRoot (page2, {data: this.getData});

but get message from: (getRootNav) is deprecated and will be removed in the next major release. Use getRootNavById instead.

so I want to know how to go from page1 to page2 with getRootNavById.

Typically one would just inject a NavController in page1 and call its push() method with page2 and whatever extra parameters are required. That’s the flow users will be expecting.

If i’m inside of a tab and i want to set root another page calling a function… what’s the proper way to achieve this?

Actually i use this:,{text: '505'});

ok so I got this going for now, but…
if they change the id, Im in deep doo, doo.

first i did…


and got -


n4 scares me

so i did

let newRootNav = <NavController>'n4');

this works but if they change the name, and we loose getRootNav().id


please don’t remove this capability, Ioinc Team

Just gonna link my post which has the same subject getRootNav() deprecated, use getRootNavById(): what's the value of the root nav id?

and also the github issue