I'm configuring my routes on my angular2 application:
So, on app.routes.ts:
export const ROUTES: Routes = [{
path: '', redirectTo: 'login', pathMatch: 'full'
}, {
path: 'app', loadChildren: () => System.import('./layout/layout.module')
}, {
path: 'login', loadChildren: () => System.import('./login/login.module')
}, {
path: 'validate/:id/:token', loadChildren: () => System.import('./validate/validate.module')
}, {
path: 'error', component: ErrorComponent
}, {
path: '**', component: ErrorComponent
}
];
Currently, I'm facing up with two problems:
- When I go to
http://localhost:3000, it's redirected tohttp://localhost:3000/Living%20User%20Platform#/login: I don't quite to figure out why thisLiving%20User%20Platform#is added to url, instead ofhttp://localhost:3000/login. - As you can see I'm setting a route with two parameters:
validate/:id/:token. Nevertheless, when I'm writting this url (http://localhost:3001/Living%20User%20Platform#/validate?id=sdfsdf&token=sdfsdf) on browser, it goes to error route:
ValidateModule.ts:
export const routes = [
{path: '', component: Validate, pathMatch: 'full'}
];
@NgModule({
declarations: [
// Components / Directives/ Pipes
Validate
],
imports: [
CommonModule,
FormsModule,
RouterModule.forChild(routes),
]
})
export default class ValidateModule {
static routes = routes;
}
Any ideas?