Modal opens but does not display content - ngx-smart-modal

I use Angular 5 with version 5.2.9, and I use ngx-smart-modal, and when I open Modal, it does not present content and is very close to the top and reduced, the attached image is attached.

const reasons = '<h1>Reasons</h1>';
this.ngxSmartModalService.setModalData(this.sanitizer.bypassSecurityTrustHtml(reasons), 'reasonsModal');
this.ngxSmartModalService.getModal('reasonsModal').open();

<ngx-smart-modal #reasonsModal identifier="reasonsModal" (onDismiss)="clearModal()" (onClose)="clearModal()">
  <div *ngIf="reasonsModal.hasData()" [innerHTML]="reasonsModal.getData()">
    <pre>{{reasonsModal.getData}}</pre>
  </div>
  <button (click)="reasonsModal.close()">Closes</button>
</ngx-smart-modal>
Run codeHide result

Image error

+4
source share
1 answer

Perhaps the reason is missing function brackets:

{{reasonsModal.getData}}

When in fact should be:

{{reasonsModal.getData()}}
0
source

Source: https://habr.com/ru/post/1695761/


All Articles