πŸ“Š Angular
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

πŸ‘οΈ
36
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
90%
Success Rate