import {Component, Input, ElementRef} from '@angular/core'; @Component({ selector: 'availableOn', template: `
Available On
{{available.downloadName}} [{{i+1}}] {{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 showAll: boolean = false; constructor (private element: ElementRef) {} ngOnInit() {} public scroll() { console.info("scroll into view"); if (typeof document !== 'undefined') { this.element.nativeElement.scrollIntoView(); } } }