import {Component, Input, ElementRef} from '@angular/core'; @Component({ selector: 'availableOn', template: `
Available On
{{available.downloadName}} [{{(i+1) | number}}] {{available.downloadName}} via {{available.collectedName}} ({{available.type}}, {{available.year}})
View less
...
View more
` }) export class AvailableOnComponent { @Input() availableOn: { "downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string }[]; public threshold: number = 5; public showNum: number = 5; constructor (private element: ElementRef) {} ngOnInit() {} public scroll() { console.info("scroll into view"); if (typeof document !== 'undefined') { this.element.nativeElement.scrollIntoView(); } } }