2017-12-19 13:53:46 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {RouterHelper} from '../../../utils/routerHelper.class';
|
|
|
|
|
|
|
|
//Usage Example "<project-title [project]="X" > </project-title>"
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'project-title',
|
|
|
|
template: `
|
|
|
|
<span class="project-title">
|
|
|
|
<span ><a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])" routerLinkActive="router-link-active" routerLink="/search/project" >{{project['name']}} ({{project['funderName']}})</a></span>
|
|
|
|
</span>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class ProjectTitleFormatter {
|
|
|
|
@Input() project: string[];
|
2018-02-05 14:14:59 +01:00
|
|
|
@Input() searchLink: string;
|
2017-12-19 13:53:46 +01:00
|
|
|
public url:string;
|
|
|
|
public routerHelper:RouterHelper = new RouterHelper();
|
|
|
|
constructor () {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
2018-02-05 14:14:59 +01:00
|
|
|
this.url =this.searchLink+ "?projectId=" + this.project["openaireId"];
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
}
|