How can i route in an Angular 2 app without changing the URL? (this is because the app is located under one of several tabs on a page of a Django app, where it\'s suitable t
this.router.navigateByUrl('path', { skipLocationChange: true });
also worked for me.
In Routes array I also added my path to load a component as below:
const appRoutes: Routes = [
{ path: 'Account/MySchool', component: MySchoolComponent }
];
And in the file from there i need to replace the component, initialize router object like below and call at required place
import { Router } from '@angular/router';
constructor(private router: Router) { }
onSubmit() {
this._requestService.postPageOneData("Account/SavePageOneData", this.userProfile)
.subscribe((response) => {
if(response.status == 'success'){
this.router.navigateByUrl('Account/PageTwoSelection', { skipLocationChange: true });
}
}, this.handleErrorSubscribed );
}