import { Component, OnInit, Input } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { Observable } from 'rxjs';
import { RemoteDesktopManager } from '../../../src/services';
@Component({
selector: 'app-clipboard-modal',
template: `
Text copied/cut within the remote desktop will appear here.
Sending the text below will affect the remote desktop clipboard.
`
})
export class ClipboardModalComponent implements OnInit {
@Input()
manager: RemoteDesktopManager;
private text = '';
private clipboardData = [];
private clipboardSubscription;
constructor(public activeModal: NgbActiveModal) {
}
ngOnInit() {
this.clipboardSubscription = this.manager.onRemoteClipboardData;
this.clipboardSubscription.subscribe(data => this.text = data);
}
public close() {
this.activeModal.close(null);
}
submit() {
this.activeModal.close(this.text);
}
}