Newer
Older
Website / src / app / alert / alert.service.ts
import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { AlertComponent } from './alert.component';

@Injectable({
  providedIn: 'root'
})
export class AlertService {

  constructor(private dialog: MatDialog) { }

  alert(title: string, content: string) {
    this.dialog.open(AlertComponent, {data: {title: title, content: content}})
  }
}