2018-08-19 20:37:53 +00:00
|
|
|
import { Component } from '@angular/core';
|
|
|
|
|
|
|
|
|
|
|
|
import { OpenLPService } from './openlp.service';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'openlp-remote-alert',
|
|
|
|
template: `
|
|
|
|
<h3>Send an Alert</h3>
|
|
|
|
<mat-form-field>
|
|
|
|
<input matInput [(ngModel)]="alert" type="text" placeholder="Alert"></mat-form-field>
|
|
|
|
<div>
|
|
|
|
<button mat-raised-button color="warn" (click)="onSubmit()">Send</button>
|
|
|
|
</div>
|
|
|
|
`,
|
|
|
|
providers: [OpenLPService]
|
|
|
|
})
|
|
|
|
|
|
|
|
export class OpenLPAlertComponent {
|
|
|
|
|
|
|
|
public alert: string;
|
|
|
|
|
|
|
|
constructor(private openlpService: OpenLPService) { }
|
|
|
|
|
|
|
|
onSubmit() {
|
|
|
|
console.log('submitted: ', this.alert);
|
2018-08-20 13:25:28 +00:00
|
|
|
this.openlpService.showAlert(this.alert).subscribe(res => console.log(res));
|
2018-08-19 20:37:53 +00:00
|
|
|
this.alert = '';
|
|
|
|
}
|
|
|
|
}
|