Q. How do you navigate to another route in Angular programmatically?

  • (A) location.href = '/route'
  • (B) this.route.go('/route')
  • (C) this.router.navigate(['/route'])
  • (D) window.location.replace('/route')
πŸ’¬ Discuss
βœ… Correct Answer: (C) this.router.navigate(['/route'])
Explanation: Use the Router service’s `navigate` method to change routes programmatically.
Explanation by: Mr. Dubey
Use the Router service’s `navigate` method to change routes programmatically.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
87
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
94%
Success Rate