1 import {Component, OnInit, Input} from '@angular/core';
2 import {NetService} from '@eg/core/net.service';
3 import {OrgService} from '@eg/core/org.service';
4 import {PcrudService} from '@eg/core/pcrud.service';
5 import {CatalogService} from '@eg/share/catalog/catalog.service';
6 import {BibRecordService, BibRecordSummary} from '@eg/share/catalog/bib-record.service';
9 selector: 'eg-bib-summary',
10 templateUrl: 'bib-summary.component.html',
11 styles: ['.eg-bib-summary .card-header {padding: .25rem .5rem}']
13 export class BibSummaryComponent implements OnInit {
18 // If provided, the record will be fetched by the component.
19 @Input() recordId: number;
21 // Otherwise, we'll use the provided bib summary object.
22 summary: BibRecordSummary;
23 @Input() set bibSummary(s: any) {
25 if (this.initDone && this.summary) {
26 this.summary.getBibCallNumber();
31 private bib: BibRecordService,
32 private cat: CatalogService,
33 private net: NetService,
34 private org: OrgService,
35 private pcrud: PcrudService
41 this.summary.getBibCallNumber();
50 this.bib.getBibSummary(this.recordId).toPromise()
52 summary.getBibCallNumber();
53 this.bib.fleshBibUsers([summary.record]);
54 this.summary = summary;
55 console.log(this.summary.display);
59 orgName(orgId: number): string {
61 return this.org.get(orgId).shortname();