I have a Router <router-outlet></router-outlet> that includes the following route:
{ path: 'employee/:id', component: EmployeeComponent }
With an EmployeeComponent component already inside the router-outlet with a specific employee, I do the following in my code: this.router.navigateByUrl('/employee/'+this.employee2);
The url changes but the component does not execute the ngOnInit() method with the new Employee, and the content is not refreshed. I need to instantiate a new EmployeeComponent with an EmployeeComponent already on my router, or refresh the existing one. How can fix that?
ActivatedRoute