//Importing libraries import { Component, OnInit } from '@angular/core'; import { DynamicDialogRef, DynamicDialogConfig, DialogService } from 'primeng/api'; //Importing service classes import { CompanyService } from '../../../shared/service/company.service'; @Component({ selector: 'app-bulk-deletion-confirm', templateUrl: './bulk-deletion-confirm.component.html', styleUrls: ['./bulk-deletion-confirm.component.css'] }) export class BulkDeletionConfirmComponent implements OnInit { constructor( public ref: DynamicDialogRef, public config: DynamicDialogConfig, private companyService: CompanyService, public dialogService: DialogService ) { } selectedContacts: string[] msgType1: string msgType2: string msg: string reply: string ngOnInit() { this.selectedContacts = this.config.data.selectedContacts; this.msgType1 = "Are you want to delete this contact?" this.msgType2 = "Are you want to delete these contacts?" if(this.selectedContacts.length == 1){ this.msg = this.msgType1 } else{ this.msg = this.msgType2 } } deleteContacts(){ this.reply = "Yes"; this.dialogService.dialogComponentRef.instance.close(); } closePopup() { this.reply = "No" this.dialogService.dialogComponentRef.instance.close(); } }