Simplify routing configuration.
This commit is contained in:
parent
f36a0bfa92
commit
bbac3e67bc
@ -24,20 +24,16 @@ import { OperationEditComponent } from './operationEdit.component';
|
|||||||
import { OperationDeleteModalComponent } from './operationDeleteModal.component';
|
import { OperationDeleteModalComponent } from './operationDeleteModal.component';
|
||||||
import { OperationFormComponent } from './operationForm.component';
|
import { OperationFormComponent } from './operationForm.component';
|
||||||
import { OperationEditModalComponent } from './operationEditModal.component';
|
import { OperationEditModalComponent } from './operationEditModal.component';
|
||||||
import { OperationListState } from './operation.states';
|
import { OperationRoutes } from './operation.states';
|
||||||
import { OperationNewState } from './operation.states';
|
|
||||||
import { OperationEditState } from './operation.states';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
RouterModule.forChild([
|
RouterModule.forChild(
|
||||||
OperationListState,
|
OperationRoutes
|
||||||
OperationNewState,
|
),
|
||||||
OperationEditState
|
|
||||||
]),
|
|
||||||
NgLoggerModule,
|
NgLoggerModule,
|
||||||
ToastrModule,
|
ToastrModule,
|
||||||
NgbModule,
|
NgbModule,
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
||||||
|
|
||||||
|
import { Routes } from '@angular/router';
|
||||||
|
|
||||||
import { OperationListComponent } from './operationList.component';
|
import { OperationListComponent } from './operationList.component';
|
||||||
import { OperationNewComponent } from './operationNew.component';
|
import { OperationNewComponent } from './operationNew.component';
|
||||||
import { OperationEditComponent } from './operationEdit.component';
|
import { OperationEditComponent } from './operationEdit.component';
|
||||||
|
|
||||||
export const OperationListState = {
|
export const OperationRoutes: Routes = [{
|
||||||
path: 'account/:accountId/operations',
|
path: 'account/:accountId/operations',
|
||||||
component: OperationListComponent,
|
component: OperationListComponent,
|
||||||
onSameUrlNavigation: 'reload'
|
//onSameUrlNavigation: 'reload'
|
||||||
};
|
}, {
|
||||||
|
|
||||||
export const OperationNewState = {
|
|
||||||
path: 'account/:accountId/operations/new',
|
path: 'account/:accountId/operations/new',
|
||||||
component: OperationNewComponent,
|
component: OperationNewComponent,
|
||||||
};
|
}, {
|
||||||
|
|
||||||
export const OperationEditState = {
|
|
||||||
path: 'account/:accountId/operations/:operationId/edit',
|
path: 'account/:accountId/operations/:operationId/edit',
|
||||||
component: OperationEditComponent,
|
component: OperationEditComponent,
|
||||||
};
|
}];
|
||||||
|
Loading…
Reference in New Issue
Block a user