The RouterOutlet Placeholder

In this lesson, we'll learn how to use the RouterOutlet element to load a component for a route.

We’re able to load the <app-home-main> component in the app’s template. However, it’s not what we’re aiming for. We want to load it if the client is requesting the homepage. The Angular Router can help us with this. First, we’ll need to make some modifications to our modules.

Understanding routing

Routing is the idea of tying components to a path in the URL. URLs are mainly comprised of a domain and a path.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy