Skip to content
Snippets Groups Projects
Commit 0f7ec400 authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Add notification to footer-buttons to confirm

parent 0aeeb9f2
No related merge requests found
import { Component, OnInit } from '@angular/core';
import { AuthenticationService } from '../../../services/http/authentication.service';
import { NotificationService } from '../../../services/util/notification.service';
import { Router } from '@angular/router';
import { MatDialog } from '@angular/material';
......@@ -15,7 +14,6 @@ export class FooterComponent implements OnInit {
dsgvoUrl = 'https://arsnova.thm.de/blog/datenschutzerklaerung/';
imprUrl = 'https://arsnova.thm.de/blog/impressum/';
constructor(
public authenticationService: AuthenticationService,
public notificationService: NotificationService,
public router: Router,
public dialog: MatDialog
......@@ -25,6 +23,9 @@ export class FooterComponent implements OnInit {
}
navToBlog() {
this.notificationService.show('Der Blog wird in einem neuen Fenster geöffnet', 'Okay!' , {
duration: 3000
});
window.open(this.blogUrl, '_blank');
}
navToDSGVO() {
......
......@@ -10,8 +10,8 @@ export class NotificationService {
constructor(private snackBar: MatSnackBar) {
}
show(message: string, config?: MatSnackBarConfig) {
show(message: string, action?: string, config?: MatSnackBarConfig) {
// Delegate the message and merge the (optionally) passed config with the default config
this.snackBar.open(message, '', Object.assign({}, this.defaultConfig, config));
this.snackBar.open(message, action, Object.assign({}, this.defaultConfig, config));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment