mirror of https://gitlab.com/openlp/web-remote.git
Display snackbar when submitting an alert
This commit is contained in:
parent
994367c147
commit
1949be3b73
|
@ -2,6 +2,7 @@ import { Component } from '@angular/core';
|
|||
|
||||
|
||||
import { OpenLPService } from '../../openlp.service';
|
||||
import { MatSnackBar } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector: 'openlp-remote-alert',
|
||||
|
@ -14,11 +15,11 @@ export class OpenLPAlertComponent {
|
|||
|
||||
public alert: string;
|
||||
|
||||
constructor(private openlpService: OpenLPService) { }
|
||||
constructor(private openlpService: OpenLPService, private snackBar: MatSnackBar) { }
|
||||
|
||||
onSubmit() {
|
||||
console.log('submitted: ', this.alert);
|
||||
this.openlpService.showAlert(this.alert).subscribe(res => {});
|
||||
this.openlpService.showAlert(this.alert).subscribe(res => this.snackBar.open('Alert submitted', '', {duration: 2000}));
|
||||
this.alert = '';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue