48 lines
1.7 KiB
TypeScript
48 lines
1.7 KiB
TypeScript
import {Component, Input} from '@angular/core';
|
|
import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
|
|
|
@Component({
|
|
selector: 'showIdentifiers',
|
|
template: `
|
|
<div *ngIf="identifiers != undefined && identifiers.size > 0">
|
|
<dt>Identifiers:</dt>
|
|
<dd>
|
|
<ul class="list-inline">
|
|
<li *ngFor="let key of identifiers.keys()">
|
|
<div *ngFor="let item of identifiers.get(key)">
|
|
<div [ngSwitch]="key">
|
|
<template [ngSwitchCase]="'doi'">
|
|
<a class="custom-external" href="{{doiURL}}{{item}}" target="_blank">
|
|
{{key}}: {{item}}
|
|
</a>
|
|
</template>
|
|
<template [ngSwitchCase]="'pmc'">
|
|
<a class="custom-external" href="{{pmcURL}}{{item}}" target="_blank">
|
|
{{key}}: {{item}}
|
|
</a>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</dd>
|
|
</div>
|
|
|
|
`
|
|
})
|
|
|
|
export class ShowIdentifiersComponent {
|
|
@Input() identifiers: Map<string, string[]>;//Map<string, string>;
|
|
doiURL: string;
|
|
pmcURL: string;
|
|
|
|
constructor () {
|
|
console.info('showIdentifiers constructor');
|
|
this.doiURL = OpenaireProperties.getDoiURL();
|
|
this.pmcURL = OpenaireProperties.getPmcURL();
|
|
}
|
|
|
|
ngOnInit() {
|
|
}
|
|
}
|