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 {
17 @Input() set expand(e: boolean) {
18 this.expandDisplay = e;
21 // If provided, the record will be fetched by the component.
22 @Input() recordId: number;
24 // Otherwise, we'll use the provided bib summary object.
25 summary: BibRecordSummary;
26 @Input() set bibSummary(s: any) {
28 if (this.initDone && this.summary) {
29 this.summary.getBibCallNumber();
34 private bib: BibRecordService,
35 private cat: CatalogService,
36 private net: NetService,
37 private org: OrgService,
38 private pcrud: PcrudService
44 this.summary.getBibCallNumber();
53 this.bib.getBibSummary(this.recordId).toPromise()
55 summary.getBibCallNumber();
56 this.bib.fleshBibUsers([summary.record]);
57 this.summary = summary;
58 console.log(this.summary.display);
62 orgName(orgId: number): string {
64 return this.org.get(orgId).shortname();