2018-08-19 20:37:53 +00:00
|
|
|
import { Component } from '@angular/core';
|
2021-01-03 18:05:10 +00:00
|
|
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
2018-08-19 20:37:53 +00:00
|
|
|
|
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';
|
2018-08-19 20:37:53 +00:00
|
|
|
|
|
|
|
@Component({
|
2019-10-06 00:28:36 +00:00
|
|
|
selector: 'openlp-alert',
|
|
|
|
templateUrl: './alert.component.html',
|
|
|
|
styleUrls: ['./alert.component.scss'],
|
|
|
|
providers: [OpenLPService]
|
2018-08-19 20:37:53 +00:00
|
|
|
})
|
|
|
|
|
2019-10-06 00:28:36 +00:00
|
|
|
export class AlertComponent {
|
2018-08-19 20:37:53 +00:00
|
|
|
|
|
|
|
public alert: string;
|
|
|
|
|
2019-11-07 18:02:26 +00:00
|
|
|
constructor(private pageTitleService: PageTitleService, private openlpService: OpenLPService,
|
|
|
|
private snackBar: MatSnackBar) {
|
|
|
|
pageTitleService.changePageTitle('Alerts');
|
|
|
|
}
|
2018-08-19 20:37:53 +00:00
|
|
|
|
|
|
|
onSubmit() {
|
2019-10-08 05:43:49 +00:00
|
|
|
this.openlpService.showAlert(this.alert).subscribe(res => this.snackBar.open('Alert submitted', '', {duration: 2000}));
|
2018-08-19 20:37:53 +00:00
|
|
|
}
|
|
|
|
}
|