import { Component } from
'@angular/core'
;
import { MessageService } from
'primeng/api'
;
@Component({
selector:
'app-root'
,
templateUrl:
'./app.component.html'
,
styleUrls: [
'./app.component.scss'
],
providers: [MessageService],
})
export class AppComponent {
constructor(
private messageService: MessageService,
) { }
ConfirmBox() {
this
.messageService.addAll([
{
key:
'gfg'
, severity:
'success'
,
summary:
'Hey Geek, are you sure?'
},
{
key:
'gfg'
, severity:
'info'
,
summary:
'Hey Geek, are you sure?'
},
]);
}
confirm() {
this
.messageService.clear(
'gfg'
);
}
reject() {
this
.messageService.clear(
'gfg'
);
}
clear() {
this
.messageService.clear();
}
}