import { Injectable } from '@angular/core' ; import { MessageService } from 'primeng/api' ; @ Injectable ( { providedIn : 'root' , } ) export class ToastService { constructor ( private messageService ) { } param severity param summary param detail addSingle ( severity , summary , detail ) { this . messageService . add ( { severity : severity , summary : summary , detail : detail } ) ; } param messages addMultiple ( messages ) { this . messageService . addAll ( messages ) ; } /**
     * clear all toast messages
     */ clear ( ) { this . messageService . clear ( ) ; } }