web-remote/src/app/alert.component.ts

31 lines
689 B
TypeScript
Raw Normal View History

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));
this.alert = '';
}
}