1 |
43765
|
argiro.kok
|
import {Component, Input} from '@angular/core';
|
2 |
|
|
import {PublicationTitleFormatter} from './publicationTitleFormatter.component';
|
3 |
|
|
import {ProjectTitleFormatter} from './projectTitleFormatter.component';
|
4 |
|
|
|
5 |
|
|
//Usage Example "<claim-entity [entity]="" [type]="" > </claim-entity>"
|
6 |
|
|
|
7 |
|
|
//externalUrl
|
8 |
|
|
@Component({
|
9 |
|
|
selector: 'claim-entity',
|
10 |
|
|
template: `
|
11 |
|
|
|
12 |
|
|
<div *ngIf="type == 'publication' || type == 'dataset'">
|
13 |
|
|
<i>({{type}}) </i>
|
14 |
|
|
<publication-title [title]="entity.title" [url]="entity.externalUrl" ></publication-title>
|
15 |
|
|
</div>
|
16 |
|
|
<div *ngIf="type == 'project' ">
|
17 |
|
|
<i>(Project)</i>
|
18 |
|
|
<project-title [project]="entity"></project-title>
|
19 |
|
|
</div>
|
20 |
|
|
<div *ngIf="type == 'context' ">
|
21 |
|
|
<i>(Context)</i>
|
22 |
|
|
<h5>{{entity.title}}</h5>
|
23 |
|
|
</div>
|
24 |
|
|
`,
|
25 |
|
|
directives: [PublicationTitleFormatter,ProjectTitleFormatter]
|
26 |
|
|
})
|
27 |
|
|
|
28 |
|
|
export class ClaimEntityFormatter {
|
29 |
|
|
@Input() entity: string[];
|
30 |
|
|
@Input() type: string;
|
31 |
|
|
|
32 |
|
|
constructor () {}
|
33 |
|
|
|
34 |
|
|
ngOnInit() {
|
35 |
|
|
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
}
|