import { Component, Pipe, PipeTransform, Input, OnInit } from '@angular/core'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { AuthService } from '../auth.service'; import { DocumentViewerService } from './document-viewer.service'; import { ASDocument } from '../document'; @Component({ selector: 'document-viewer', templateUrl: './document-viewer.component.html' , styleUrls: ['./document-viewer.component.css'], }) export class DocumentViewerComponent implements OnInit { @Input() document: ASDocument; showInfo = true; displayInfoPanel = 'show-class'; displayInfoMinPanel = 'hide-class'; showMoreMetaData = false; moreMetaDataClass = 'hide-class'; toggleMetaData = "Show More"; toggleInfo(): void { this.showInfo = !this.showInfo; this.displayInfoPanel = this.showInfo ? 'show-class' : 'hide-class'; this.displayInfoMinPanel = this.showInfo ? 'hide-class' : 'show-class'; }; toggleMoreMetaData(): void { this.showMoreMetaData = !this.showMoreMetaData; this.moreMetaDataClass = this.showMoreMetaData ? 'show-class' : 'hide-class'; this.toggleMetaData = this.showMoreMetaData ? 'Show More' : 'Show Less'; } closeViewer(): void { this.document = undefined; } ngOnInit(): void { /* constructor( private documentViewerService: DocumentViewerService, private route: ActivatedRoute, private location: Location ) {} this.route.params .switchMap((params: Params) => this.documentViewerService.getDocument(+params['id'])) .subscribe(document => this.document = document); */ } }