在这里我使用Angular2 Lazy Loading参数基于Routing Plase帮助为什么我得到Error: Cannot match any routes: 'EditById/1113'
这里我从表中传递此Id
<tr *ngFor="let emp of employee">
<td><a href="#" (click)="GetById($event,emp)">{{emp.EmpName}}</a></td>
GetById(e, emp) {
debugger;
this.id = emp.Emp_Id;
this._router.navigate(['/EditById/' + this.id])
}
这是我的MainRoute.ts
export const ApplicationRoutes:Routes= [
{ path: 'EditById/:id', loadChildren: '../modules/employee/editemployeebyidmdule#EitEmployeeModule' },
EmployeeRoute.ts
import { Routes } from "@angular/router"
import { EditEmployeeByIdComponent } from "../components/employeecomponent/editemployeebyidcomponent"
export const EmployeeRoute=[
{ path: 'id', component: EditEmployeeByIdComponent}
]
它应该是,
this._router.navigate(['EditById', this.id])