Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing modal body markup #4633

Open
alexandis opened this issue Nov 21, 2023 · 0 comments
Open

Accessing modal body markup #4633

alexandis opened this issue Nov 21, 2023 · 0 comments

Comments

@alexandis
Copy link

alexandis commented Nov 21, 2023

Hi. Is there a less hacky way to access modal body markup (Angular 15, if it matters) than:

    const mapLayerModalRef = this.modalService.open(this.mapLayerContent, { centered: true, size: 'xl' });
    mapLayerModalRef.dismissed.subscribe(() => {
      const dialogRef = (mapLayerModalRef as any)._windowCmptRef.instance._dialogEl as ElementRef;
      this.mapLayerContentBodyMarkup = (mapLayerContentBody as HTMLElement).innerHTML; //accessing modal body markup in a very hacky way
    });

?

Markup:

<ng-template #mapLayerContent let-modal let-c="close" let-d="dismiss">
  ...
  <div class="modal-body"><!-- Need to access this markup --></div>
</ng-template>

I've tried different approaches (e.g. using this.mapLayerContent TemplateRef), but in vain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant