The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Understand the Angular 2 Base href Requirement

Understand the Angular 2 Base href Requirement

3:48
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.
Watch this lesson now
Avatar
egghead.io

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.

Avatar
JACOB

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]

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?