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 { 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,
|
||||
|
@ -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,
|
||||
};
|
||||
}];
|
||||
|
Loading…
Reference in New Issue
Block a user