Suggest an editImprove this articleRefine the answer for “How do you navigate to a route programmatically?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Programmatic navigation to a route is done using the **Router** service, via the `navigate()` or `navigateByUrl()` method. **Key point:** both methods do not reload the page and simply update the `router-outlet`.Shown above the full answer for quick recall.Answer (EN)ImageProgrammatic navigation to a route is done using the `Router` service. To do this: 1. Inject `Router` into the component: ```typescript constructor(private router: Router) {} ``` 2. Use the `navigate()` or `navigateByUrl()` method: ```typescript this.router.navigate(['/profile']); ``` or with parameters: ```typescript this.router.navigate(['/user', userId]); ``` The difference: - `navigate()` - takes an array of path segments and options; - `navigateByUrl()` - takes a route string. Both methods do not reload the page and simply update the `router-outlet`.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.