//Importing the libraries import { Component, OnInit } from '@angular/core'; import { DynamicDialogRef, DynamicDialogConfig, DialogService } from 'primeng/api'; //Importing the core classes import { IEmailTemplate } from '../../../shared/core/IEmailTemplate'; @Component({ selector: 'app-contact-loadtemplate-preview', templateUrl: './contact-loadtemplate-preview.component.html', styleUrls: ['./contact-loadtemplate-preview.component.scss'], providers: [DialogService] }) export class ContactLoadtemplatePreviewComponent implements OnInit { emailTemplateDetails: IEmailTemplate subject: string editorContent: string constructor( public ref: DynamicDialogRef, public config: DynamicDialogConfig, public dialogService: DialogService ) { } /** ngOnInit() starts */ ngOnInit() { this.emailTemplateDetails = this.config.data.emailTemplateDetails; this.subject = this.emailTemplateDetails[0].Title; this.editorContent = this.emailTemplateDetails[0].TemplateContent; } /** Ends - ngOnInit() */ // show the template of preview cancel() { this.dialogService.dialogComponentRef.destroy(); } }