import {Component, Input, ElementRef} from '@angular/core'; import {RouterHelper} from '../../utils/routerHelper.class'; @Component({ selector: 'showAuthors', template: `
View less authors
{{author}} ; ... {{author}} ; view all {{authors.length | number}} authors View less authors
` }) export class ShowAuthorsComponent { @Input() authors: { [key: string]: string }[]; @Input() searchPage:string ="publications" public showAll: boolean = false; public routerHelper:RouterHelper = new RouterHelper(); constructor (private element: ElementRef) { } ngOnInit() { } public quote(params: string):string { return '"'+params+'"'; } public scroll() { console.info("scroll into view"); if (typeof document !== 'undefined') { this.element.nativeElement.scrollIntoView(); } } }