openaire-library/claims/claim-utils/entityFormatter/publicationTitleFormatter.c...

38 lines
1.1 KiB
TypeScript
Raw Normal View History

import {Component, Input} from '@angular/core';
import {RouterHelper} from '../../../utils/routerHelper.class';
//Usage Example "<publication-title [title]="X" [url]="X" > </publication-title>"
@Component({
selector: 'publication-title',
template: `
<span *ngIf="!externalPortalUrl" class="publication-title">
<span *ngIf="id" ><a [queryParams]="routerHelper.createQueryParam(param,id)" routerLinkActive="router-link-active" [routerLink]="path" > {{title}}</a></span>
<!--span *ngIf="url" class="uk-margin-small-left" ><a target="_blank" href="{{url}}" >
(<span class="custom-external custom-icon" ></span>link)</a></span-->
</span>
<span *ngIf="externalPortalUrl" class="publication-title">
<span *ngIf="id" ><a [href] = "externalPortalUrl + path+'?'+param+'='+id" > {{title}}</a></span>
</span>
`
})
export class PublicationTitleFormatter {
@Input() title: string;
@Input() url: string;
@Input() id: string;
@Input() param: string;
@Input() path: string;
@Input() externalPortalUrl:string = null;
public routerHelper:RouterHelper = new RouterHelper();
constructor () {}
ngOnInit() {
}
}