How to reset the navigation (router) stack?


#1

I know that v4 its still in beta but some things about the navigation docs have confused me a little.

  1. will the NavController be deprecated ? Y/N ?
    In the doc it says " In v4, major changes were made to navigation and routing. NavController and ion-nav have now been deprecated. They can still used, but only if an app is not using lazy loading."

  2. how i can reset the nav stack to remove the back button? i.e. setting the homepage as root

Using the router this didn’t worked:
this.router.navigate(['/auth/home'], { replaceUrl: true });

I had to use the NavController:
this.nav.navigateRoot('/auth/home');

  1. is it ok to use the Location service from angular to go back ?
import {Location} from '@angular/common';
this.location.back();