unlayer/angular-email-editor

email-editor support under the NgbModal?

Opened this issue · 0 comments

I tried to Put an email editor inside the NgbModal. But, it gives an editor undefined.

<button class="btn btn-primary" (click)="openDialog(openModal)">>Open Dialog</button>

<ng-template #openModal let-modal>
    <div class="modal-header bg-white">       
    </div>
    <div class="modal-body bg-white pl-0 pr-0 pt-0 pb-0">
           <email-editor #emailEditor (loaded)="editorLoaded()" (ready)="editorReady()"></email-editor>
    </div>
</ng-template>


openDialog() {
 this.modalService.open(targetModal, {
        size: 'md',
        backdrop: true
      });
}
  
public editorLoaded() {
}

public editorReady() {
     this.emailEditor?.editor?.loadDesign();
}

public exportHtml() {
      //Here it gives the error
     //core.mjs:6494 ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'editor')
     //TypeError: Cannot read properties of undefined (reading 'editor')

      this.emailEditor.editor.exportHtml((data) => {
      });

 }

Does anyone know if this works with NgbModal or not?