Minor tweak to alerts

This commit is contained in:
Simon Hanna 2018-09-10 15:17:22 +02:00
parent 91d902d07c
commit 5eba4581f6
2 changed files with 1 additions and 3 deletions

View File

@ -3,5 +3,5 @@
<mat-form-field>
<input matInput [(ngModel)]="alert" type="text" name="alert" placeholder="Alert" required>
</mat-form-field>
<button mat-raised-button color="primary" id="sendButton" [disabled]="!alertForm.form.valid" (click)="onSubmit()">Send</button>
<button mat-raised-button color="primary" id="sendButton" [disabled]="!alertForm.form.valid" (click)="onSubmit(); alertForm.reset()">Send</button>
</form>

View File

@ -18,8 +18,6 @@ export class OpenLPAlertComponent {
constructor(private openlpService: OpenLPService, private snackBar: MatSnackBar) { }
onSubmit() {
console.log('submitted: ', this.alert);
this.openlpService.showAlert(this.alert).subscribe(res => this.snackBar.open('Alert submitted', '', {duration: 2000}));
this.alert = '';
}
}