Understand the Angular Base href Requirement

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

The <base href=”/”/> you define will determine how all other assets you plan on loading treat their relative paths. While you’ll most often use / as your base href, it’s important to understand what’s going on in case you need to change how you’re hosting your project.

JACOB
~ 8 years ago

Can you target a child router-outlet? I have a base template that has a router-outlet for my app as a whole. When a user logs in, I load a SecureComponent in that base router-outlet. The SecureComponent has a template with nav links in it and another router-outlet. When I click on the nav links in the SecureComponent's nav links it loads the respective component in the base router-outlet instead of the router-outlet in the SecureComponent. Is there any way I can tell the routerLink attribute to target the secure component's router-outlet instead of the base router-outlet?

I have a simple example here: (Example)[https://plnkr.co/edit/YxidcgAJaNjlrQnINnmw?p=preview]