0

I am using NbDialogService from the Nebular component package to open Dialog components.

I am using something like this:

const dialogRef = this.dialogService.open(MyDialogComponent, { ... });

I am trying to load the dialog using the new capability of angular 9 to lazy load specific component without the need to load a whole module

Something like this:

 import('./dialogs/my-dlg.component').then(({ MyDialogComponent}) => {
      const component = this.componentFactoryResolver.resolveComponentFactory(MyDialogComponent);

        this.dialogService.open(MyDialogComponent, {
          context: {
            dlgTitle: 'Add Product',
            topLabel : 'Add Product(s)'

          }
        }).onClose.subscribe((ev)=> {
        });
     });

But the dialog is does not show up correctly

Any ideas how to solve it?

Maayan Hope
  • 1,482
  • 17
  • 32
  • is there any error in the console ? and since you are already creating an instance of the component, did you consider attaching it to a templateRef, and then use the templateRef instead of the type itself ? – Munzer Jul 10 '20 at 16:41
  • I am not sure how to get the templateRef – Maayan Hope Jul 11 '20 at 14:17

0 Answers0