1
|
import {Component, Input} from '@angular/core';
|
2
|
|
3
|
//Usage Example "<publication-title [title]="X" [url]="X" > </publication-title>"
|
4
|
|
5
|
@Component({
|
6
|
selector: 'publication-title',
|
7
|
template: `
|
8
|
<span class="publication-title">
|
9
|
<span *ngIf="url" ><a target="_blank" href="{{url}}" ><span class="custom-external custom-icon" ></span> {{title}}</a></span>
|
10
|
<span *ngIf="!url" >{{title}}</span>
|
11
|
</span>
|
12
|
`
|
13
|
})
|
14
|
|
15
|
export class PublicationTitleFormatter {
|
16
|
@Input() title: string[];
|
17
|
@Input() url: string[];
|
18
|
|
19
|
constructor () {}
|
20
|
|
21
|
ngOnInit() {
|
22
|
|
23
|
}
|
24
|
|
25
|
|
26
|
}
|