Ionic 4 Navigation - NavController or Router


Q: Can we use the NavController for long term?

The Ionic v4 migration guide says:
" NavController and ion-nav have now been deprecated".
However, when I checked thesource code of NavController I saw that it wraps the Ionic Router. Plus handles the page transition / animation which is very useful.

Does the Ionic team plan to remove the NavController?

If the NavController is depricated, what is the preferred way to define the direction of the page transition in the TS code?

Thanks in advance!

1 Like

Can you link to the place where you saw this?

I read this:

In V4, navigation received the most changes. Now, instead of using Ionic’s own NavController , we integrate with the official Angular Router.

From what I understood, they didn’t mean it was deprecated, but instead of building their own NavController from scratch, it is now built on top of the AngularRouter.

NavController is still useful to manage the back button and to keep pages in the stack without initializing every page every time they are invoked with the router like Angular apps do.

I think that in the end they are just using AngularRouter for the raw navigation while building and maintaining the framework specific features in their NavController as a stack of pages.

This is just what I understood, so I might be wrong.
There seems to be quite a bit of ambiguity on the subject, even other articles are mentioning that it’s deprecated.