私は現在、自分のアプリケーションで素敵なルートを取得しようとしていますが、私の現在の実装では、私のルートサブスクリプションのすべてのパラメータを取得してチェックする必要があります。 employees
またはdepartments
というような、すべての可能性についてすべてのパラメータ値をチェックするのではなく、前もって差をつけることができる「静的」パラメータを得る方法はありますか?
私のルートのいずれかが非論理的であるか間違っている場合、改善のために開かれています。Angular2 URLからすべてのパラメータを取得するにはホットですか?
export const EmployeeManagementRoutes: RouterConfig = [
{
path: 'employee-management',
component: EmployeeManagementComponent,
children: [
//display all employees
{
path: '',
//is there any way to make this redirict relative to the component the router is for?
redirectTo: '/employee-management/employees/department/all',
pathMatch: 'full'
},
//display all employees from a specific department
{
path: 'employees//department/:department',
component: EmployeeManagementTableComponent
},
//open dialog for deleting or creating a new employee or
if option is 'show' and id is not undefined show a specific employee
{
path: 'employees/action/:option/:id',
component: EmployeeManagementTableComponent
},
//display all departments
{
path: 'departments',
component: EmployeeManagementTableComponent
},
//open dialog for deleting or creating a new department
{
path: 'departments/action/:option',
component: EmployeeManagementTableComponent
},
]
}
];
ありがとうございます。それがまさに私が探し求めたものでした。 – moessi774