accountant-ui/src/operations/operationDeleteModal.component.ts

46 lines
1.0 KiB
TypeScript
Raw Normal View History

2017-07-30 15:22:25 +02:00
// 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");
}
}