40 lines
978 B
TypeScript
40 lines
978 B
TypeScript
import {Component, Input} from '@angular/core';
|
|
import {PublicationTitleFormatter} from './publicationTitleFormatter.component';
|
|
import {ProjectTitleFormatter} from './projectTitleFormatter.component';
|
|
|
|
//Usage Example "<claim-entity [entity]="" [type]="" > </claim-entity>"
|
|
|
|
//externalUrl
|
|
@Component({
|
|
selector: 'claim-entity',
|
|
template: `
|
|
|
|
<div *ngIf="type == 'publication' || type == 'dataset'">
|
|
<i>({{type}}) </i>
|
|
<publication-title [title]="entity.title" [url]="entity.externalUrl" ></publication-title>
|
|
</div>
|
|
<div *ngIf="type == 'project' ">
|
|
<i>(Project)</i>
|
|
<project-title [project]="entity"></project-title>
|
|
</div>
|
|
<div *ngIf="type == 'context' ">
|
|
<i>(Context)</i>
|
|
<h5><a target="_blank" >{{entity.title}}</a></h5>
|
|
</div>
|
|
`,
|
|
directives: [PublicationTitleFormatter,ProjectTitleFormatter]
|
|
})
|
|
|
|
export class ClaimEntityFormatter {
|
|
@Input() entity: string[];
|
|
@Input() type: string;
|
|
|
|
constructor () {}
|
|
|
|
ngOnInit() {
|
|
|
|
}
|
|
|
|
|
|
}
|