The Router.navigate is used to specify a root URL through relative navigation. Here’s a function using the above to navigate through different articles in Angular:

BY Best Interview Question ON 25 Mar 2020

Example

gotoDetails(articleId: any) {
   this.router.navigate(['/blog/', blogId]);
}