Simplify routing configuration.

This commit is contained in:
Alexis Lahouze 2018-06-13 22:09:10 +02:00
parent f36a0bfa92
commit bbac3e67bc
2 changed files with 11 additions and 17 deletions

View File

@ -24,20 +24,16 @@ import { OperationEditComponent } from './operationEdit.component';
import { OperationDeleteModalComponent } from './operationDeleteModal.component';
import { OperationFormComponent } from './operationForm.component';
import { OperationEditModalComponent } from './operationEditModal.component';
import { OperationListState } from './operation.states';
import { OperationNewState } from './operation.states';
import { OperationEditState } from './operation.states';
import { OperationRoutes } from './operation.states';
@NgModule({
imports: [
HttpClientModule,
CommonModule,
ReactiveFormsModule,
RouterModule.forChild([
OperationListState,
OperationNewState,
OperationEditState
]),
RouterModule.forChild(
OperationRoutes
),
NgLoggerModule,
ToastrModule,
NgbModule,

View File

@ -1,21 +1,19 @@
// vim: set tw=80 ts=2 sw=2 sts=2 :
import { Routes } from '@angular/router';
import { OperationListComponent } from './operationList.component';
import { OperationNewComponent } from './operationNew.component';
import { OperationEditComponent } from './operationEdit.component';
export const OperationListState = {
export const OperationRoutes: Routes = [{
path: 'account/:accountId/operations',
component: OperationListComponent,
onSameUrlNavigation: 'reload'
};
export const OperationNewState = {
//onSameUrlNavigation: 'reload'
}, {
path: 'account/:accountId/operations/new',
component: OperationNewComponent,
};
export const OperationEditState = {
}, {
path: 'account/:accountId/operations/:operationId/edit',
component: OperationEditComponent,
};
}];