1 import {Component, OnInit, Input, Output, ViewChild, EventEmitter} from '@angular/core';
2 import {Observable, Observer, of} from 'rxjs';
3 import {NetService} from '@eg/core/net.service';
4 import {OrgService} from '@eg/core/org.service';
5 import {AuthService} from '@eg/core/auth.service';
7 /** Hold details read-only view */
10 selector: 'eg-hold-detail',
11 templateUrl: 'detail.component.html'
13 export class HoldDetailComponent implements OnInit {
16 @Input() set holdId(id: number) {
23 hold: any; // wide hold reference
24 @Input() set wideHold(wh: any) {
29 @Output() onShowList: EventEmitter<any>;
32 private net: NetService,
33 private org: OrgService,
34 private auth: AuthService,
36 this.onShowList = new EventEmitter<any>();
45 if (!this._holdId) { return; }
49 'open-ils.circ.hold.wide_hash.stream',
50 this.auth.token(), {id: this._holdId}
51 ).subscribe(wideHold => {
56 getOrgName(id: number) {
58 return this.org.get(id).shortname();
63 this.onShowList.emit();