Prepare Edit and New separation.
This commit is contained in:
parent
c92b1bed11
commit
45207d6500
@ -19,10 +19,14 @@ import { OperationRowComponent } from './operationRow.component';
|
|||||||
import { CategoryService } from './category.service';
|
import { CategoryService } from './category.service';
|
||||||
import { OperationService } from './operation.service';
|
import { OperationService } from './operation.service';
|
||||||
import { OperationListComponent } from './operationList.component';
|
import { OperationListComponent } from './operationList.component';
|
||||||
|
import { OperationNewComponent } from './operationNew.component';
|
||||||
|
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 { OperationListState } from './operation.states';
|
||||||
|
import { OperationNewState } from './operation.states';
|
||||||
|
import { OperationEditState } from './operation.states';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@ -30,7 +34,9 @@ import { OperationListState } from './operation.states';
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
RouterModule.forChild([
|
RouterModule.forChild([
|
||||||
OperationListState
|
OperationListState,
|
||||||
|
OperationNewState,
|
||||||
|
OperationEditState
|
||||||
]),
|
]),
|
||||||
NgLoggerModule,
|
NgLoggerModule,
|
||||||
ToastrModule,
|
ToastrModule,
|
||||||
@ -48,6 +54,8 @@ import { OperationListState } from './operation.states';
|
|||||||
CategoryChartComponent,
|
CategoryChartComponent,
|
||||||
OperationRowComponent,
|
OperationRowComponent,
|
||||||
OperationListComponent,
|
OperationListComponent,
|
||||||
|
OperationEditComponent,
|
||||||
|
OperationNewComponent,
|
||||||
OperationDeleteModalComponent,
|
OperationDeleteModalComponent,
|
||||||
OperationFormComponent,
|
OperationFormComponent,
|
||||||
OperationEditModalComponent,
|
OperationEditModalComponent,
|
||||||
|
@ -1,9 +1,21 @@
|
|||||||
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
||||||
|
|
||||||
import { OperationListComponent } from './operationList.component';
|
import { OperationListComponent } from './operationList.component';
|
||||||
|
import { OperationNewComponent } from './operationNew.component';
|
||||||
|
import { OperationEditComponent } from './operationEdit.component';
|
||||||
|
|
||||||
export const OperationListState = {
|
export const OperationListState = {
|
||||||
path: 'account/:accountId/operations',
|
path: 'account/:accountId/operations',
|
||||||
component: OperationListComponent,
|
component: OperationListComponent,
|
||||||
onSameUrlNavigation: 'reload'
|
onSameUrlNavigation: 'reload'
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export const OperationNewState = {
|
||||||
|
path: 'account/:accountId/operations/new',
|
||||||
|
component: OperationNewComponent,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const OperationEditState = {
|
||||||
|
path: 'account/:accountId/operations/:operationId/edit',
|
||||||
|
component: OperationEditComponent,
|
||||||
|
};
|
||||||
|
20
src/operations/operationEdit.component.ts
Normal file
20
src/operations/operationEdit.component.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
||||||
|
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'operation-edit',
|
||||||
|
template: `
|
||||||
|
<div>
|
||||||
|
<div class="row">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class OperationEditComponent implements OnInit {
|
||||||
|
ngOnInit(): void {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
19
src/operations/operationNew.component.ts
Normal file
19
src/operations/operationNew.component.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
||||||
|
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'operation-new',
|
||||||
|
template: `
|
||||||
|
<div>
|
||||||
|
<div class="row">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class OperationNewComponent implements OnInit {
|
||||||
|
ngOnInit(): void {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user