Add Operation Delete Modal component.
This commit is contained in:
parent
072efe7fc3
commit
b5e4b1cd08
@ -14,6 +14,7 @@ import { OperationRowComponent } from './operationRow.component';
|
||||
import { CategoryService } from './category.service';
|
||||
import { OperationService } from './operation.service';
|
||||
import { OperationListComponent } from './operationList.component';
|
||||
import { OperationDeleteModalComponent } from './operationDeleteModal.component';
|
||||
|
||||
export function $modalServiceFactory(i: any) {
|
||||
return i.get('$modal');
|
||||
@ -49,12 +50,14 @@ export function accountIdServiceFactory(i: any) {
|
||||
CategoryChartComponent,
|
||||
OperationRowComponent,
|
||||
OperationListComponent,
|
||||
OperationDeleteModalComponent,
|
||||
],
|
||||
entryComponents: [
|
||||
BalanceChartComponent,
|
||||
CategoryChartComponent,
|
||||
OperationRowComponent,
|
||||
OperationListComponent,
|
||||
OperationDeleteModalComponent,
|
||||
]
|
||||
})
|
||||
export class OperationModule {}
|
||||
|
45
src/operations/operationDeleteModal.component.ts
Normal file
45
src/operations/operationDeleteModal.component.ts
Normal file
@ -0,0 +1,45 @@
|
||||
// vim: set tw=80 ts=2 sw=2 sts=2:
|
||||
import { Component, Input } from '@angular/core';
|
||||
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
import { Operation } from './operation';
|
||||
|
||||
@Component({
|
||||
selector: 'operation-delete-modal',
|
||||
template: `
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" id="modal-title">Delete Operation #{{ operation.id }}</h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body" id="modal-body">
|
||||
<p>
|
||||
Do you really want to delete operation #{{ operation.id }} with label:<br/>
|
||||
{{ operation.label }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-danger" (click)="submit()">
|
||||
Yes
|
||||
</button>
|
||||
|
||||
<button class="btn btn-default" (click)="cancel()">
|
||||
No
|
||||
</button>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export class OperationDeleteModalComponent {
|
||||
@Input() operation: Operation
|
||||
|
||||
constructor(private activeModal: NgbActiveModal) {}
|
||||
|
||||
submit(): void {
|
||||
this.activeModal.close(this.operation);
|
||||
}
|
||||
|
||||
cancel(): void {
|
||||
this.activeModal.dismiss("closed");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user