explore-services/portal/src/app/landingPages/showIdentifiers.component.ts

49 lines
1.6 KiB
TypeScript

import {Component, Input} from '@angular/core';
import {Router, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
@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 [ngSwitchWhen]="'doi'">
<a class="custom-external" href="http://dx.doi.org/{{item}}" target="_blank">
{{key}}: {{item}}
</a>
</template>
<template [ngSwitchWhen]="'pmc'">
<a class="custom-external" href="http://europepmc.org/articles/{{item}}" target="_blank">
{{key}}: {{item}}
</a>
</template>
</div>
</div>
</li>
</ul>
</dd>
</div>
`
,
directives: [
...ROUTER_DIRECTIVES
]
})
export class ShowIdentifiersComponent {
@Input() identifiers: Map<string, string[]>;//Map<string, string>;
constructor (private _router: Router) {
console.info('showIdentifiers constructor');
}
ngOnInit() {
}
}