web-remote/src/app/components/main-view/main-view.component.ts

23 lines
620 B
TypeScript

import { Component, OnInit } from '@angular/core';
import { OpenLPService } from '../../openlp.service';
@Component({
selector: 'app-main-view',
templateUrl: './main-view.component.html',
styleUrls: ['./main-view.component.scss', '../overlay.scss']
})
export class MainViewComponent implements OnInit {
img: string;
constructor(private openlpService: OpenLPService) { }
ngOnInit() {
this.updateImage();
this.openlpService.stateChanged$.subscribe(item => this.updateImage());
}
updateImage(): void {
this.openlpService.getMainImage().subscribe(view => this.img = view.binary_image);
}
}