import {Component, Inject, Input, PLATFORM_ID} from '@angular/core'; import {ActivatedRoute} from "@angular/router"; import {HelperFunctions} from '../HelperFunctions.class'; import {RouterHelper} from "../routerHelper.class"; import {EnvProperties} from '../properties/env-properties'; import {isPlatformBrowser} from "@angular/common"; import {Author} from "../result-preview/result-preview"; import {AlertModal} from "../modal/alert"; import {properties} from "../../../../environments/environment"; @Component({ selector: 'showAuthors', template: `
{{author.fullName + "; "}} {{" "}} {{author.fullName + "; "}}
{{author.fullName}}
ORCID

Search {{author.fullName}} in OpenAIRE
...
View all {{authors.length | number}} authors
View less authors
` }) export class ShowAuthorsComponent { @Input() authors: Author[]; @Input() authorsLimit: number = 30; @Input() showAll: boolean = true; @Input() small: boolean = true; @Input() modal: AlertModal; public numberOfAuthors: number; public properties: EnvProperties = properties; public routerHelper: RouterHelper = new RouterHelper(); testBrowser: boolean; constructor(private route: ActivatedRoute, @Inject(PLATFORM_ID) private platformId: string) { this.testBrowser = isPlatformBrowser(platformId); } ngOnInit() { this.numberOfAuthors = this.authorsLimit; } copyToClipboard(element: HTMLInputElement) { element.select(); if (typeof document !== 'undefined') { document.execCommand('copy'); } } public scroll() { HelperFunctions.scroll(); } public onClick() { if (this.modal) { this.modal.cancel(); } } }