Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Commit e9e7617

Browse files
committed
feat(operators): default route to first operator when no name supplied
1 parent 7f3ce3c commit e9e7617

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/app/operators/operators-routing.module.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,24 @@ import { Routes, RouterModule } from '@angular/router';
33

44
import { OperatorsComponent } from './operators.component';
55
import { OperatorComponent } from './components/operator/operator.component';
6+
import { ALL_OPERATORS } from '../../operator-docs';
67

78
const routes: Routes = [
89
{
910
path: '',
1011
component: OperatorsComponent,
1112
data: { title: ['Operators'], description: 'All the RxJS operators...' },
12-
children: [{ path: ':operator', component: OperatorComponent }]
13+
children: [
14+
{
15+
path: ':operator',
16+
component: OperatorComponent
17+
},
18+
{
19+
path: '',
20+
redirectTo: ALL_OPERATORS[0].name,
21+
pathMatch: 'full'
22+
}
23+
]
1324
}
1425
];
1526

0 commit comments

Comments
 (0)