Challenge: Implement Navigation System Using Routing
Complete the challenge of implementing routing in an Angular application.
We'll cover the following
Problem statement
Implement a navigation system that allows users to navigate between views using Angular router.
Requirements
In the initial code setup provided below, a simple Angular application with three components home
, profile
, and settings
has been created. You are required to implement the following tasks:
Set up Angular router to enable navigation between these components.
Implement a navigation menu with links to each component, allowing users to switch between views.
Implement functionality to change the style of a route when it is active.
Ensure that each component has a unique URL, and you can bookmark and share these URLs.
Utilize route parameters or query parameters to pass data between components dynamically.
Handle cases where users navigate to invalid URLs, and implement appropriate error handling or redirects.
Expected output
When you run the application, you should see a default route “Home” as follows:
Get hands-on with 1400+ tech skills courses.