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

27 lines
762 B
TypeScript
Raw Normal View History

import { Component } from '@angular/core';
2019-11-07 18:02:26 +00:00
import { MatSnackBar } from '@angular/material';
2019-11-07 18:02:26 +00:00
import { PageTitleService } from '../../page-title.service';
2018-08-22 20:04:41 +00:00
import { OpenLPService } from '../../openlp.service';
@Component({
selector: 'openlp-alert',
templateUrl: './alert.component.html',
styleUrls: ['./alert.component.scss'],
providers: [OpenLPService]
})
export class AlertComponent {
public alert: string;
2019-11-07 18:02:26 +00:00
constructor(private pageTitleService: PageTitleService, private openlpService: OpenLPService,
private snackBar: MatSnackBar) {
pageTitleService.changePageTitle('Alerts');
}
onSubmit() {
2019-10-08 05:43:49 +00:00
this.openlpService.showAlert(this.alert).subscribe(res => this.snackBar.open('Alert submitted', '', {duration: 2000}));
}
}