I have a very simple app
My app.component.html looks like this:
<a [routerLink]="['/Test']">CLICK ME</a>
<div class="main-container">
<router-outlet></router-outlet>
</div>
My app.component.ts looks like this:
@Component({
selector: 'app',
templateUrl: 'app/app.component.html',
directives: [HomeComponent, TestComponent, ROUTER_DIRECTIVES]
})
@RouteConfig([
{path: '/', component: HomeComponent, as: 'HomeComponent'},
{path: '/test', component: TestComponent, as: 'Test'}
])
export class AppComponent { }
To navigate to my app, I go to
http://localhost/app
Which works perfect, it navigates me to my home component view as expected. When I click the "CLICK ME" button, I am navigated to
http://localhost/app/test
And my test component is rendered as expected... HOWEVER, if I manually navigate to
http://localhost/app/test
My home component is loaded instead of my test component...what gives? How can I set up routing so that manual navigation to the test url actually returns my test component's view in the router outlet? Is this possible? I don't want to go to the landing page every time...