Angular2 version: rc3
Router version: 3.0.0-alfa7
boot.ts:
import { provideRouter, RouterConfig } from '@angular/router';
import {AppComponent} from "./main/app.component"
import {UsersComponent, UserListComponent, UserEditComponent} from "./users/index"
export const routes: RouterConfig = [
{ path: "", redirectTo: "users", terminal: true },
{
path: "users",
component: UsersComponent,
children: [
{ path: "create", component: UserEditComponent },
{ path: "edit/:id", component: UserEditComponent },
{ path: "", component: UserListComponent }
]
}
];
export const APP_ROUTER_PROVIDERS = [
provideRouter(routes)
];
When I launch application, router redirects to /users and UserListComponent works just fine.
I have two issues:
- Navigation to /users/edit/:id from UserListComponent works only through [routerLink] directive (e.g. [routerLink]="['edit', 17]"). But then I try to navigate from UserListComponent using Router itself (e.g. router.navigate(['edit', 17])) then nothing happens;
- Navigation to /users from it's child components doesn't work any way. I have tried [routerLink]="['/users']", router.navigate(['/users']). Should be noted that [routerLink]="['/users']" renders to a valid anchor tag: <'a href="http://localhost/users"><'/a>