import {Component, Input} from '@angular/core'; import {ClaimEntity} from '../../claim-utils/claimHelper.class'; import {StringUtils} from "../../../utils/string-utils.class"; @Component({ selector: 'claim-title', template: ` {{entity.title ? sliceString(entity.title) : '[No title available]'}} {{entity.title ? sliceString(entity.title) : '[No title available]'}} {{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}} {{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}} {{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}} {{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}} {{entity.context.community }} > {{entity.context.category}} > {{entity.context.concept.label}} ` }) export class ClaimEntityTitleComponent { @Input() entity: ClaimEntity; @Input() slice:boolean = false; @Input() sliceSize:number = 45; @Input() shortVersion: boolean = false; ngOnInit() { } sliceString(mystr:string): string { if(this.slice){ return StringUtils.sliceString(mystr,this.sliceSize); } return mystr; } }