I have a method named "leave()" in which, we are redirecting the page to dashboard. Whenever I uses this method by button click, it's working fine.
There is another scenario where it called by signalr event(Subject). In this case, page is redirecting successfully, but components on the dashboard page not loading properly.
In below code "OnLeaveAll" is Subject type in "hubService".
ngOnInit(): void {
this.hubService.OnLeaveAll.subscribe(x => {
this.leave();
});
}
leave() {
this.router.navigate(['app', 'dashboard']);
}