1 import {Component, OnInit, Output, Input, ViewChild, EventEmitter} from '@angular/core';
2 import {CircService} from './circ.service';
3 import {DialogComponent} from '@eg/share/dialog/dialog.component';
4 import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap';
5 import {EgEvent} from '@eg/core/event.service';
6 import {StringService} from '@eg/share/string/string.service';
9 * Prompt to confirm overriding circulation events.
13 templateUrl: 'events-dialog.component.html',
14 selector: 'eg-circ-events-dialog'
16 export class CircEventsComponent extends DialogComponent implements OnInit {
18 @Input() events: EgEvent[] = [];
19 @Input() mode: 'checkout' | 'renew' | 'checkin';
22 patronId: number = null;
27 private modal: NgbModal,
28 private strings: StringService
32 this.onOpen$.subscribe(_ => {
33 this.strings.interpolate('circ.events.mode.' + this.mode)
34 .then(str => this.modeLabel = str);
38 isArray(target: any): boolean {
39 return Array.isArray(target);